本文整理汇总了C++中QXmppConfiguration::setStreamSecurityMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppConfiguration::setStreamSecurityMode方法的具体用法?C++ QXmppConfiguration::setStreamSecurityMode怎么用?C++ QXmppConfiguration::setStreamSecurityMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmppConfiguration
的用法示例。
在下文中一共展示了QXmppConfiguration::setStreamSecurityMode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: connectHost
void QxmppPeer::connectHost( const std::string & jid, const std::string & password,
const std::string & host, int port, bool tls )
{
QXmppConfiguration conf;
conf.setJid( jid.c_str() );
conf.setPassword( password.c_str() );
if ( host.size() > 0 )
conf.setHost( host.c_str() );
if ( port > 0 )
conf.setPort( port );
conf.setAutoReconnectionEnabled( true );
//conf.setUseNonSASLAuthentication( true );
if ( tls )
conf.setStreamSecurityMode( QXmppConfiguration::TLSEnabled );
else
conf.setStreamSecurityMode( QXmppConfiguration::TLSDisabled );
connectToServer( conf );
}
示例2: connectToWindowsLive
void ChatClient::connectToWindowsLive(const QString &accessToken)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setWindowsLiveAccessToken(accessToken);
config.setDomain("messenger.live.com");
config.setSaslAuthMechanism("X-MESSENGER-OAUTH2");
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
// NOTE: messenger.live.com uses a certificate with an incorrect name
config.setIgnoreSslErrors(true);
QXmppClient::connectToServer(config);
}
示例3: connectToFacebook
void ChatClient::connectToFacebook(const QString &appId, const QString &accessToken)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setFacebookAppId(appId);
config.setFacebookAccessToken(accessToken);
config.setDomain("chat.facebook.com");
config.setSaslAuthMechanism("X-FACEBOOK-PLATFORM");
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
config.setIgnoreSslErrors(false);
QXmppClient::connectToServer(config);
}
示例4: connectToServer
void ChatClient::connectToServer(const QString &jid, const QString &password)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setJid(jid);
config.setPassword(password);
// don't ignore SSL errors for wifirst and gmail, but do for other domains
if (config.domain() == "wifirst.net" || config.domain() == "gmail.com" || config.domain() == "googlemail.com") {
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
config.setIgnoreSslErrors(false);
}
QXmppClient::connectToServer(config);
}
示例5: connectToGoogle
void ChatClient::connectToGoogle(const QString &jid, const QString &accessToken)
{
QXmppConfiguration config;
config.setResource(qApp->applicationName());
config.setGoogleAccessToken(accessToken);
config.setJid(jid);
config.setSaslAuthMechanism("X-OAUTH2");
config.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
// don't ignore SSL errors for gmail, but do for other domains (google apps hosted domains)
if (config.domain() == "gmail.com" || config.domain() == "googlemail.com")
config.setIgnoreSslErrors(false);
QXmppClient::connectToServer(config);
}
示例6: normalizeUser
void Lvk::CA::XmppChatbot::connectToServer(const QString &user, const QString &passwd,
const QString &domain)
{
m_user = normalizeUser(user);
m_domain = normalizeDomain(domain);
QXmppConfiguration conf;
conf.setDomain(m_domain);
conf.setUser(m_user);
conf.setPassword(passwd);
conf.setStreamSecurityMode(QXmppConfiguration::TLSRequired);
m_xmppClient->connectToServer(conf);
// QString jid = m_user + "@" + m_domain;
// qDebug() << "XmppChatbot: Connecting with jid:" << jid;
// m_xmppClient->connectToServer(jid, passwd);
}
示例7: connectToXmppServer
void MyXmppClient::connectToXmppServer() {
QXmppConfiguration xmppConfig;
xmppConfig.setJid( m_myjid );
xmppConfig.setPassword( m_password );
xmppConfig.setKeepAliveInterval( m_keepAlive );
xmppConfig.setAutoAcceptSubscriptions(false);
xmppConfig.setSaslAuthMechanism("DIGEST-MD5");
xmppConfig.setUseSASLAuthentication(true);
xmppConfig.setStreamSecurityMode(QXmppConfiguration::TLSEnabled);
/*******************/
if( m_resource.isEmpty() || m_resource.isNull() ) xmppConfig.setResource( "Lightbulb" ); else xmppConfig.setResource( m_resource );
if( !m_host.isEmpty() ) xmppConfig.setHost( m_host );
if( m_port != 0 ) xmppConfig.setPort( m_port );
xmppClient->connectToServer( xmppConfig );
}