- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions

# QSslSocket Class Reference

Search for all occurrences

## Detailed Description

Definition at line 67 of file qsslsocket.h.

`#include <qsslsocket.h>`

Inheritance diagram for QSslSocket:
[legend]

List of all members.

## Public Types
enum | SslMode { UnencryptedMode, SslClientMode, SslServerMode }
enum | PeerVerifyMode { VerifyNone, QueryPeer, VerifyPeer, AutoVerifyPeer }
## Public Slots
void | startClientEncryption ()
void | startServerEncryption ()
void | ignoreSslErrors ()
## Signals
void | encrypted ()
void | peerVerifyError (const QSslError &error)
void | sslErrors (const QList< QSslError > &errors)
void | modeChanged (QSslSocket::SslMode newMode)
void | encryptedBytesWritten (qint64 totalBytes)
## Public Member Functions
| QSslSocket (QObject *parent=0)
| ~QSslSocket ()
void | connectToHostEncrypted (const QString &hostName, quint16 port, OpenMode mode=ReadWrite)
void | connectToHostEncrypted (const QString &hostName, quint16 port, const QString &sslPeerName, OpenMode mode=ReadWrite)
bool | setSocketDescriptor (int socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite)
void | setSocketOption (QAbstractSocket::SocketOption option, const QVariant &value)
QVariant | socketOption (QAbstractSocket::SocketOption option)
SslMode | mode () const
bool | isEncrypted () const
QSsl::SslProtocol | protocol () const
void | setProtocol (QSsl::SslProtocol protocol)
QSslSocket::PeerVerifyMode | peerVerifyMode () const
void | setPeerVerifyMode (QSslSocket::PeerVerifyMode mode)
int | peerVerifyDepth () const
void | setPeerVerifyDepth (int depth)
qint64 | bytesAvailable () const
qint64 | bytesToWrite () const
bool | canReadLine () const
void | close ()
bool | atEnd () const
bool | flush ()
void | abort ()
void | setReadBufferSize (qint64 size)
qint64 | encryptedBytesAvailable () const
qint64 | encryptedBytesToWrite () const
QSslConfiguration | sslConfiguration () const
void | setSslConfiguration (const QSslConfiguration &config)
void | setLocalCertificate (const QSslCertificate &certificate)
void | setLocalCertificate (const QString &fileName, QSsl::EncodingFormat format=QSsl::Pem)
QSslCertificate | localCertificate () const
QSslCertificate | peerCertificate () const
QList< QSslCertificate > | peerCertificateChain () const
QSslCipher | sessionCipher () const
void | setPrivateKey (const QSslKey &key)
void | setPrivateKey (const QString &fileName, QSsl::KeyAlgorithm algorithm=QSsl::Rsa, QSsl::EncodingFormat format=QSsl::Pem, const QByteArray &passPhrase=QByteArray())
QSslKey | privateKey () const
QList< QSslCipher > | ciphers () const
void | setCiphers (const QList< QSslCipher > &ciphers)
void | setCiphers (const QString &ciphers)
bool | addCaCertificates (const QString &path, QSsl::EncodingFormat format=QSsl::Pem, QRegExp::PatternSyntax syntax=QRegExp::FixedString)
void | addCaCertificate (const QSslCertificate &certificate)
void | addCaCertificates (const QList< QSslCertificate > &certificates)
void | setCaCertificates (const QList< QSslCertificate > &certificates)
QList< QSslCertificate > | caCertificates () const
bool | waitForConnected (int msecs=30000)
bool | waitForEncrypted (int msecs=30000)
bool | waitForReadyRead (int msecs=30000)
bool | waitForBytesWritten (int msecs=30000)
bool | waitForDisconnected (int msecs=30000)
QList< QSslError > | sslErrors () const
void | ignoreSslErrors (const QList< QSslError > &errors)
## Static Public Member Functions
static void | setDefaultCiphers (const QList< QSslCipher > &ciphers)
static QList< QSslCipher > | defaultCiphers ()
static QList< QSslCipher > | supportedCiphers ()
static bool | addDefaultCaCertificates (const QString &path, QSsl::EncodingFormat format=QSsl::Pem, QRegExp::PatternSyntax syntax=QRegExp::FixedString)
static void | addDefaultCaCertificate (const QSslCertificate &certificate)
static void | addDefaultCaCertificates (const QList< QSslCertificate > &certificates)
static void | setDefaultCaCertificates (const QList< QSslCertificate > &certificates)
static QList< QSslCertificate > | defaultCaCertificates ()
static QList< QSslCertificate > | systemCaCertificates ()
static bool | supportsSsl ()
## Protected Slots
void | connectToHostImplementation (const QString &hostName, quint16 port, OpenMode openMode)
void | disconnectFromHostImplementation ()
## Protected Member Functions
qint64 | readData (char *data, qint64 maxlen)
qint64 | writeData (const char *data, qint64 len)

## Member Enumeration Documentation

enum SslMode

Search for all occurrences

Enumerator:

  UnencryptedMode | Search for all occurrences
  SslClientMode | Search for all occurrences
  SslServerMode | Search for all occurrences

Definition at line 71 of file qsslsocket.h.

                     {
            UnencryptedMode,
            SslClientMode,
            SslServerMode
        };

enum PeerVerifyMode

Search for all occurrences

Enumerator:

  VerifyNone | Search for all occurrences
  QueryPeer | Search for all occurrences
  VerifyPeer | Search for all occurrences
  AutoVerifyPeer | Search for all occurrences

Definition at line 77 of file qsslsocket.h.

                            {
            VerifyNone,
            QueryPeer,
            VerifyPeer,
            AutoVerifyPeer
        };

## Constructor & Destructor Documentation

QSslSocket | ( | QObject * | parent = `0` | ) |

~QSslSocket | ( |  | ) |

## Member Function Documentation

void connectToHostEncrypted | ( | const QString & | hostName,
|  | quint16 | port,
|  | OpenMode | mode = `ReadWrite`
| ) |  |

Search for all occurrences

void connectToHostEncrypted | ( | const QString & | hostName,
|  | quint16 | port,
|  | const QString & | sslPeerName,
|  | OpenMode | mode = `ReadWrite`
| ) |  |

Search for all occurrences

bool setSocketDescriptor | ( | int | socketDescriptor,
|  | SocketState | state = `ConnectedState`,
|  | OpenMode | openMode = `ReadWrite`
| ) |  |

Search for all occurrences

Reimplemented from QAbstractSocket.

void setSocketOption | ( | QAbstractSocket::SocketOption | option,
|  | const QVariant & | value
| ) |  |

Search for all occurrences

Reimplemented from QAbstractSocket.

QVariant socketOption | ( | QAbstractSocket::SocketOption | option | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

SslMode mode | ( |  | ) | const

Search for all occurrences

bool isEncrypted | ( |  | ) | const

Search for all occurrences

QSsl::SslProtocol protocol | ( |  | ) | const

Search for all occurrences

void setProtocol | ( | QSsl::SslProtocol | protocol | ) |

Search for all occurrences

QSslSocket::PeerVerifyMode peerVerifyMode | ( |  | ) | const

Search for all occurrences

void setPeerVerifyMode | ( | QSslSocket::PeerVerifyMode | mode | ) |

Search for all occurrences

int peerVerifyDepth | ( |  | ) | const

Search for all occurrences

void setPeerVerifyDepth | ( | int | depth | ) |

Search for all occurrences

qint64 bytesAvailable | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

qint64 bytesToWrite | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

bool canReadLine | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

void close | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

bool atEnd | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

bool flush | ( |  | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

void abort | ( |  | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

void setReadBufferSize | ( | qint64 | size | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

qint64 encryptedBytesAvailable | ( |  | ) | const

Search for all occurrences

qint64 encryptedBytesToWrite | ( |  | ) | const

Search for all occurrences

QSslConfiguration sslConfiguration | ( |  | ) | const

Search for all occurrences

void setSslConfiguration | ( | const QSslConfiguration & | config | ) |

Search for all occurrences

void setLocalCertificate | ( | const QSslCertificate & | certificate | ) |

Search for all occurrences

void setLocalCertificate | ( | const QString & | fileName,
|  | QSsl::EncodingFormat | format = `QSsl::Pem`
| ) |  |

Search for all occurrences

QSslCertificate localCertificate | ( |  | ) | const

Search for all occurrences

QSslCertificate peerCertificate | ( |  | ) | const

Search for all occurrences

QList<QSslCertificate> peerCertificateChain | ( |  | ) | const

Search for all occurrences

QSslCipher sessionCipher | ( |  | ) | const

Search for all occurrences

void setPrivateKey | ( | const QSslKey & | key | ) |

Search for all occurrences

void setPrivateKey | ( | const QString & | fileName,
|  | QSsl::KeyAlgorithm | algorithm = `QSsl::Rsa`,
|  | QSsl::EncodingFormat | format = `QSsl::Pem`,
|  | const QByteArray & | passPhrase = `QByteArray()`
| ) |  |

Search for all occurrences

QSslKey privateKey | ( |  | ) | const

Search for all occurrences

QList<QSslCipher> ciphers | ( |  | ) | const

Search for all occurrences

void setCiphers | ( | const QList< QSslCipher > & | ciphers | ) |

Search for all occurrences

void setCiphers | ( | const QString & | ciphers | ) |

Search for all occurrences

static void setDefaultCiphers | ( | const QList< QSslCipher > & | ciphers | ) | `[static]`

Search for all occurrences

static QList<QSslCipher> defaultCiphers | ( |  | ) | `[static]`

Search for all occurrences

static QList<QSslCipher> supportedCiphers | ( |  | ) | `[static]`

Search for all occurrences

bool addCaCertificates | ( | const QString & | path,
|  | QSsl::EncodingFormat | format = `QSsl::Pem`,
|  | QRegExp::PatternSyntax | syntax = `QRegExp::FixedString`
| ) |  |

Search for all occurrences

void addCaCertificate | ( | const QSslCertificate & | certificate | ) |

Search for all occurrences

void addCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |

Search for all occurrences

void setCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) |

Search for all occurrences

QList<QSslCertificate> caCertificates | ( |  | ) | const

Search for all occurrences

static bool addDefaultCaCertificates | ( | const QString & | path,
|  | QSsl::EncodingFormat | format = `QSsl::Pem`,
|  | QRegExp::PatternSyntax | syntax = `QRegExp::FixedString`
| ) |  | `[static]`

Search for all occurrences

static void addDefaultCaCertificate | ( | const QSslCertificate & | certificate | ) | `[static]`

Search for all occurrences

static void addDefaultCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) | `[static]`

Search for all occurrences

static void setDefaultCaCertificates | ( | const QList< QSslCertificate > & | certificates | ) | `[static]`

Search for all occurrences

static QList<QSslCertificate> defaultCaCertificates | ( |  | ) | `[static]`

Search for all occurrences

static QList<QSslCertificate> systemCaCertificates | ( |  | ) | `[static]`

Search for all occurrences

bool waitForConnected | ( | int | msecs = `30000` | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

bool waitForEncrypted | ( | int | msecs = `30000` | ) |

Search for all occurrences

bool waitForReadyRead | ( | int | msecs = `30000` | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

bool waitForBytesWritten | ( | int | msecs = `30000` | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

bool waitForDisconnected | ( | int | msecs = `30000` | ) |

Search for all occurrences

Reimplemented from QAbstractSocket.

QList<QSslError> sslErrors | ( |  | ) | const

Search for all occurrences

static bool supportsSsl | ( |  | ) | `[static]`

Search for all occurrences

void ignoreSslErrors | ( | const QList< QSslError > & | errors | ) |

Search for all occurrences

void startClientEncryption | ( |  | ) | `[slot]`

Search for all occurrences

void startServerEncryption | ( |  | ) | `[slot]`

Search for all occurrences

void ignoreSslErrors | ( |  | ) | `[slot]`

Search for all occurrences

void encrypted | ( |  | ) | `[signal]`

Search for all occurrences

void peerVerifyError | ( | const QSslError & | error | ) | `[signal]`

Search for all occurrences

void sslErrors | ( | const QList< QSslError > & | errors | ) | `[signal]`

Search for all occurrences

void modeChanged | ( | QSslSocket::SslMode | newMode | ) | `[signal]`

Search for all occurrences

void encryptedBytesWritten | ( | qint64 | totalBytes | ) | `[signal]`

Search for all occurrences

void connectToHostImplementation | ( | const QString & | hostName,
|  | quint16 | port,
|  | OpenMode | openMode
| ) |  | `[protected, slot]`

Search for all occurrences

Reimplemented from QAbstractSocket.

void disconnectFromHostImplementation | ( |  | ) | `[protected, slot]`

Search for all occurrences

Reimplemented from QAbstractSocket.

qint64 readData | ( | char * | data,
|  | qint64 | maxlen
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

qint64 writeData | ( | const char * | data,
|  | qint64 | len
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractSocket.

The documentation for this class was generated from the following file:

- QtNetwork/qsslsocket.h

QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket
QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket QSslSocket