Testing SSL services


If you manage web applications and servers, you may have encountered a poorly written application or a web server that periodically hangs for no reason. These issues usually pop up out of the blue, and most people rely on their user community to notifiy them when problems are detected. To ensure timely notifications when these problems occur, I developed ssl-service-check. ssl-service-check is written in Bourne shell, and uses the OpenSSL toolkit to connect to a service and issue a “GET /.” If the service fails to respond, ssl-cervice-check will log an error to syslog and send an e-mail to the address defined in the global ADMINS variable. To test if the prefetch.net web server is handling requests on TCP port 444, we can execute ssl-service-check with the “-s” (server to connect to) and “-p” (port number to connect to) options:

$ ssl-service-check.sh -s mail.prefetch.net -p 444

$ tail -1 /var/adm/messages

Nov 3 18:23:28 tigger matty: [ID 702911 daemon.notice] Failed to connect to mail.prefetch.net on Port 444

ssl-service-check was written to work with cron, and can easily be integrated with a network monitoring solution.

This article was posted by Matty on 2005-11-05 10:13:00 -0400 -0400