如何使用Jython 2.x下载https文件而不忽略ssl验证?

如何使用Jython 2.x下载https文件而不忽略ssl验证?,https,jython,Https,Jython,我使用的是Jython 2.latest,我一辈子都不知道如何安全地(即不关闭验证)下载HTTPS链接 我所能找到的似乎只是关闭验证的示例 我使用的代码就像 thefile = urllib2.urlopen("https://example.com/index.php") with open(save_path, 'wb') as output: output.write(thefile.read()) logging.info("Successfully downlo

我使用的是Jython 2.latest,我一辈子都不知道如何安全地(即不关闭验证)下载HTTPS链接

我所能找到的似乎只是关闭验证的示例

我使用的代码就像

  thefile = urllib2.urlopen("https://example.com/index.php")
  with open(save_path, 'wb') as output:
    output.write(thefile.read())
    logging.info("Successfully downloaded %s", save_path)
但我得到了一个握手错误,这完全是意料之中的

因此,我生成了ssl证书:

openssl s_客户端-showcerts-connect example.com:443/dev/null | openssl x509-outform PEM>example.PEM

现在我有了PEM文件。现在我该怎么办,有人知道吗?我是否在将PEM文件安装到密钥库中时遇到了问题

此处链接:表示只能将其添加到java密钥库