static struct mailstream_ssl_data * ssl_data_new(int fd, time_t timeout,
	void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
{
  return ssl_data_new_full(fd, timeout,
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
		TLS_client_method(),
#else
	/* Despite their name the SSLv23_*method() functions have nothing to do
	 * with the availability of SSLv2 or SSLv3. What these functions do is
	 * negotiate with the peer the highest available SSL/TLS protocol version
	 * available. The name is as it is for historic reasons. This is a very
	 * common confusion and is the main reason why these names have been
	 * deprecated in the latest dev version of OpenSSL. */
		SSLv23_client_method(),
#endif
		callback, cb_data);
}
Exemple #2
0
static struct mailstream_ssl_data * tls_data_new(int fd, time_t timeout,
  void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
{
  return ssl_data_new_full(fd, timeout, TLSv1_client_method(), callback, cb_data);
}
static struct mailstream_ssl_data * ssl_data_new(int fd, void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
{
  return ssl_data_new_full(fd, SSLv23_client_method(), callback, cb_data);
}