diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-19 18:22:37 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-19 18:22:37 +0100 | 
| commit | 78b840187cc1e2d370dd758e6a73c21e510107b5 (patch) | |
| tree | 9f801dfd335e838ee27e475b73f86838b715edcd /protocols/jabber/io.c | |
| parent | 486ddb53b93b6677dc3feeb4afaad2ea93a71a81 (diff) | |
Move conversion of status codes to status messages into SSL libs.
Diffstat (limited to 'protocols/jabber/io.c')
| -rw-r--r-- | protocols/jabber/io.c | 43 | 
1 files changed, 9 insertions, 34 deletions
| diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index 9e55e3f9..5ff8052c 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -291,45 +291,20 @@ gboolean jabber_connected_ssl( gpointer data, int returncode, void *source, b_in  		   already, set it to NULL here to prevent a double cleanup: */  		jd->ssl = NULL; -		imcb_error( ic, "Could not connect to server" ); -		if (returncode ==  OPENSSL_VERIFY_ERROR ) -		{ -			imcb_error( ic, "This BitlBee server is built agains the OpenSSL library." ); -			imcb_error( ic, "Unfortunately certificate verification is only supported when built against GnuTLS for now." ); -			imc_logout( ic, FALSE ); -		} -		else if (returncode ==  NSS_VERIFY_ERROR ) -		{ -			imcb_error( ic, "This BitlBee server is built agains the NSS library." ); -			imcb_error( ic, "Unfortunately certificate verification is only supported when built against GnuTLS for now." ); -			imc_logout( ic, FALSE ); -		} -		else if (returncode == VERIFY_CERT_ERROR ) +		if( returncode & VERIFY_CERT_INVALID)  		{ -			imcb_error( ic, "An error occured during the certificate verification." ); +			char *err = ssl_verify_strerror( returncode ); +			imcb_error( ic, "Certificate verification problem 0x%x: %s", +			            returncode, err ? err : "Unknown" ); +			g_free( err );  			imc_logout( ic, FALSE );  		} -		else if (returncode  & VERIFY_CERT_INVALID) +		else  		{ -			imcb_error( ic, "Unable to verify peer's certificate." ); -			if (returncode & VERIFY_CERT_REVOKED) -				imcb_error( ic, "The certificate has been revoked." ); -			if (returncode & VERIFY_CERT_SIGNER_NOT_FOUND) -				imcb_error( ic, "The certificate hasn't got a known issuer." ); -			if (returncode & VERIFY_CERT_SIGNER_NOT_CA) -				imcb_error( ic, "The certificate's issuer is not a CA." ); -			if (returncode & VERIFY_CERT_INSECURE_ALGORITHM) -				imcb_error( ic, "The certificate uses an insecure algorithm." ); -			if (returncode & VERIFY_CERT_NOT_ACTIVATED) -				imcb_error( ic, "The certificate has not been activated." ); -			if (returncode & VERIFY_CERT_EXPIRED) -				imcb_error( ic, "The certificate has expired." ); -			if (returncode & VERIFY_CERT_WRONG_HOSTNAME) -				imcb_error( ic, "The hostname specified in the certificate doesn't match the server name." ); -			imc_logout( ic, FALSE ); +			imcb_error( ic, "Could not connect to server" ); +			imc_logout( ic, TRUE );  		} -		else -		imc_logout( ic, TRUE ); +		  		return FALSE;  	} | 
