## CamelTcpStreamSSL

CamelTcpStreamSSL

## Synopsis

    struct              CamelTcpStreamSSL;
    #define             CAMEL_TCP_STREAM_SSL_ENABLE_SSL2
    #define             CAMEL_TCP_STREAM_SSL_ENABLE_SSL3
    #define             CAMEL_TCP_STREAM_SSL_ENABLE_TLS
    CamelStream *       camel_tcp_stream_ssl_new            (struct _CamelSession *session,
                                                             const char *expected_host,
                                                             guint32 flags);
    CamelStream *       camel_tcp_stream_ssl_new_raw        (struct _CamelSession *session,
                                                             const char *expected_host,
                                                             guint32 flags);
    int                 camel_tcp_stream_ssl_enable_ssl     (CamelTcpStreamSSL *ssl);

## Description

## Details

### struct CamelTcpStreamSSL

    struct CamelTcpStreamSSL {
    	CamelTcpStream parent_object;

    	struct _CamelTcpStreamSSLPrivate *priv;
    };

### CAMEL_TCP_STREAM_SSL_ENABLE_SSL2

    #define CAMEL_TCP_STREAM_SSL_ENABLE_SSL2   (1 << 0)

### CAMEL_TCP_STREAM_SSL_ENABLE_SSL3

    #define CAMEL_TCP_STREAM_SSL_ENABLE_SSL3   (1 << 1)

### CAMEL_TCP_STREAM_SSL_ENABLE_TLS

    #define CAMEL_TCP_STREAM_SSL_ENABLE_TLS    (1 << 2)

### camel_tcp_stream_ssl_new ()

    CamelStream *       camel_tcp_stream_ssl_new            (struct _CamelSession *session,
                                                             const char *expected_host,
                                                             guint32 flags);

Since the SSL certificate authenticator may need to prompt the user, a CamelService is needed. `expected_host` is needed as a protection against an MITM attack.

`session` : |
`expected_host` : | host that the stream is expecting to connect with.
`flags` : | flags
Returns : | a ssl stream (in ssl mode)

### camel_tcp_stream_ssl_new_raw ()

    CamelStream *       camel_tcp_stream_ssl_new_raw        (struct _CamelSession *session,
                                                             const char *expected_host,
                                                             guint32 flags);

Since the SSL certificate authenticator may need to prompt the user, a CamelService is needed. `expected_host` is needed as a protection against an MITM attack.

`session` : |
`expected_host` : | host that the stream is expecting to connect with.
`flags` : | flags
Returns : | a ssl-capable stream (in non ssl mode)

### camel_tcp_stream_ssl_enable_ssl ()

    int                 camel_tcp_stream_ssl_enable_ssl     (CamelTcpStreamSSL *ssl);

Toggles an ssl-capable stream into ssl mode (if it isn't already).

`ssl` : |
Returns : | 0 on success or -1 on fail.