你是否有人知道,如果是这样,我如何用我的应用程序代码检查服务器是否启用了ssl?
"请求宽恕比允许更容易"
例如,要stackoverflow.com
通过SSL 读取,请不要询问是否stackoverflow.com
支持它,只需执行此操作即可.在Python中:
>>> import urllib2 >>> urllib2.urlopen('https://stackoverflow.com') Traceback (most recent call last): ... urllib2.URLError:>>> html = urllib2.urlopen('http://stackoverflow.com').read() >>> len(html) 146271 >>>
它表明stackoverflow.com
不支持SSL(2008).
更新:立即 stackoverflow.com
支持https.
您没有指定编程语言,但可以从命令行执行此操作.
bash-3.2$ echo ^D | telnet www.google.com https Trying 66.102.11.104... Connected to www.l.google.com. Escape character is '^]'. Connection closed by foreign host. bash-3.2$ echo ^D | telnet www.stackoverflow.com https Trying 69.59.196.211... telnet: connect to address 69.59.196.211: Connection refused telnet: Unable to connect to remote host
你去...谷歌,StackOverflow没有.