How to check if a server has ssl enable or not


Does anyone of you know, if and if so, how can I check, with my application code, if a server has ssl enabled or not?

Best Solution

"It's easier to ask forgiveness than permission"

For example, to read via SSL, don't ask whether supports it, just do it. In Python:

>>> import urllib2
>>> urllib2.urlopen('')
Traceback (most recent call last):
urllib2.URLError: <urlopen error (10060, 'Operation timed out')>
>>> html = urllib2.urlopen('').read()
>>> len(html)

It shows that doesn't support SSL (2008).

Update: supports https now.