library/src/network/BP-NetworkSSL.cc
// Connects on an Socket (ssl)
Connects on an Socket (ssl)
Connects on an Socket ( ssl )
BP_ERROR_T BP_SSLConnect(P_BP_NETWORK_HANDLE netHandle)
{
	if(netHandle == NULL)
		return ERR_FAILURE;
	if(netHandle->sslOpts->ssl == NULL)
	{
		if(netHandle->sslOpts->context != NULL)
		{
			netHandle->sslOpts->ssl = SSL_new(netHandle->sslOpts->context);
		}
		else
		{
			return ERR_FAILURE;
		}
	}
	if(SSL_set_fd(netHandle->sslOpts->ssl, netHandle->sock) != 1)
		return ERR_FAILURE;
	if(SSL_connect(netHandle->sslOpts->ssl) != 1)
		return ERR_FAILURE;
	return ERR_SUCCESS;
}
BP_ERROR_T BP_SSLConnect ( P_BP_NETWORK_HANDLE netHandle ) { if ( netHandle == NULL ) return ERR_FAILURE ; if ( netHandle -> sslOpts -> ssl == NULL ) { if ( netHandle -> sslOpts -> context != NULL ) { netHandle -> sslOpts -> ssl = SSL_new ( netHandle -> sslOpts -> context ) ; } else { return ERR_FAILURE ; } } if ( SSL_set_fd ( netHandle -> sslOpts -> ssl , netHandle -> sock ) != 1 ) return ERR_FAILURE ; if ( SSL_connect ( netHandle -> sslOpts -> ssl ) != 1 ) return ERR_FAILURE ; return ERR_SUCCESS ; }
Connects on an Socket (ssl)
Connects on an Socket ( ssl )
// create new ssl object if one isn't there already // set fd // connect // return indicating success