Browse code

modules/tls: improve logging on SSL_get_certificate() / SSL_get_peer_certificate() error

Mikko Lehto authored on 03/06/2015 12:08:55
Showing 1 changed files
... ...
@@ -160,7 +160,11 @@ static int get_cert(X509** cert, struct tcp_connection** c, struct sip_msg* msg,
160 160
 	if (!ssl) goto err;
161 161
 	*cert = my ? SSL_get_certificate(ssl) : SSL_get_peer_certificate(ssl);
162 162
 	if (!*cert) {
163
-		ERR("Unable to retrieve TLS certificate from SSL structure\n");
163
+		if (my) {
164
+			ERR("Unable to retrieve my TLS certificate from SSL structure\n");
165
+		} else {
166
+			ERR("Unable to retrieve peer TLS certificate from SSL structure\n");
167
+		}
164 168
 		goto err;
165 169
 	}
166 170