From a9df5de4af55791e4d4aeb3533bcc715e28c1512 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 16 Mar 2001 23:02:04 +0000 Subject: Print info about the issuer of the certificate. 2001-03-16 Jeffrey Stedfast * camel-tcp-stream-ssl.c (ssl_bad_cert): Print info about the issuer of the certificate. * providers/smtp/camel-smtp-transport.c (smtp_connect): Use camel_tcp_stream_get_socket(). * camel-tcp-stream-openssl.c (stream_get_socket): Implemented. * camel-tcp-stream-ssl.c (stream_get_socket): Implemented. * camel-tcp-stream-raw.c (stream_get_socket): Implemented. * camel-tcp-stream.c (camel_tcp_stream_get_socket): New function. svn path=/trunk/; revision=8764 --- camel/providers/smtp/camel-smtp-transport.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'camel/providers/smtp') diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 93d0447c2f..9d60891f04 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -253,17 +253,19 @@ smtp_connect (CamelService *service, CamelException *ex) addrlen = sizeof (transport->localaddr); #ifdef HAVE_NSS if (use_ssl) { + PRFileDesc *sockfd = camel_tcp_stream_get_socket (CAMEL_TCP_STREAM (tcp_stream)); PRNetAddr addr; char hname[1024]; - PR_GetSockName (CAMEL_TCP_STREAM_SSL (tcp_stream)->sockfd, &addr); + PR_GetSockName (sockfd, &addr); memset (hname, 0, sizeof (hname)); PR_NetAddrToString (&addr, hname, 1023); inet_aton (hname, (struct in_addr *)&transport->localaddr.sin_addr); } else { - getsockname (CAMEL_TCP_STREAM_RAW (tcp_stream)->sockfd, - (struct sockaddr *)&transport->localaddr, &addrlen); + int sockfd = GPOINTER_TO_INT (camel_tcp_stream_get_socket (CAMEL_TCP_STREAM (tcp_stream))); + + getsockname (sockfd, (struct sockaddr *)&transport->localaddr, &addrlen); } #else getsockname (CAMEL_TCP_STREAM_RAW (tcp_stream)->sockfd, -- cgit