diff -ur monit-5.3.2/src/gc.c monit-5.3.2-maage-ssl/src/gc.c --- monit-5.3.2/src/gc.c 2011-12-20 22:40:30.000000000 +0200 +++ monit-5.3.2-maage-ssl/src/gc.c 2011-12-28 16:20:03.000000000 +0200 @@ -358,6 +358,7 @@ FREE((*s)->username); FREE((*s)->password); FREE((*s)->ssl.certmd5); + FREE((*s)->ssl.clientpemfile); FREE(*s); } @@ -403,6 +404,7 @@ FREE((*p)->hostname); FREE((*p)->pathname); FREE((*p)->SSL.certmd5); + FREE((*p)->SSL.clientpemfile); FREE((*p)->request_checksum); FREE((*p)->request_hostheader); FREE(*p); @@ -641,6 +643,7 @@ _gc_url(&(*recv)->url); FREE((*recv)->ssl.certmd5); + FREE((*recv)->ssl.clientpemfile); FREE(*recv); } diff -ur monit-5.3.2/src/socket.c monit-5.3.2-maage-ssl/src/socket.c --- monit-5.3.2/src/socket.c 2011-12-20 22:40:30.000000000 +0200 +++ monit-5.3.2-maage-ssl/src/socket.c 2011-12-28 16:20:03.000000000 +0200 @@ -157,6 +157,7 @@ ssl.use_ssl= use_ssl; ssl.version= SSL_VERSION_AUTO; ssl.certmd5= NULL; + ssl.clientpemfile= NULL; return socket_create_t(host, port, type, ssl, timeout); @@ -421,7 +422,7 @@ int socket_switch2ssl(Socket_T S, Ssl_T ssl) { - if(! (S->ssl= new_ssl_connection(NULL, ssl.version))) + if(! (S->ssl= new_ssl_connection(ssl.clientpemfile, ssl.version))) return FALSE; if(! embed_ssl_socket(S->ssl, S->socket)) diff -ur monit-5.3.2/src/ssl.h monit-5.3.2-maage-ssl/src/ssl.h --- monit-5.3.2/src/ssl.h 2011-12-20 22:40:30.000000000 +0200 +++ monit-5.3.2-maage-ssl/src/ssl.h 2011-12-28 16:20:03.000000000 +0200 @@ -49,6 +49,7 @@ int use_ssl; /**< TRUE if SSL is required for connection */ int version; /**< The SSL version to use for connection */ char *certmd5; /**< The expected md5 sum of the server's certificate */ + char *clientpemfile /**< The client certificate */ } Ssl_T; diff -ur monit-5.3.2/src/status.c monit-5.3.2-maage-ssl/src/status.c --- monit-5.3.2/src/status.c 2011-12-20 22:40:30.000000000 +0200 +++ monit-5.3.2-maage-ssl/src/status.c 2011-12-28 16:20:03.000000000 +0200 @@ -87,8 +87,25 @@ return status; } - if(!(sock= socket_new(Run.bind_addr?Run.bind_addr:"localhost", Run.httpdport, - SOCKET_TCP, Run.httpdssl, NET_TIMEOUT))) { + if (!Run.httpdssl) { + sock= socket_new(Run.bind_addr?Run.bind_addr:"localhost", Run.httpdport, + SOCKET_TCP, Run.httpdssl, NET_TIMEOUT); + } else { + Ssl_T ssl; + + ssl.use_ssl= Run.httpdssl; + ssl.version= SSL_VERSION_AUTO; + ssl.certmd5= NULL; + ssl.clientpemfile= NULL; + + if (Run.httpsslclientpem) + ssl.clientpemfile= Str_dup(Run.httpsslclientpem); + + sock= socket_create_t(Run.bind_addr?Run.bind_addr:"localhost", + Run.httpdport, SOCKET_TCP, + ssl, NET_TIMEOUT); + } + if(!sock) { LogError("%s: error connecting to the monit daemon\n", prog); return status; }