PDown百度网盘下载器:无需登录的极速下载终极方案
2025/12/23 7:29:39
在与 Windows Azure blob 存储服务进行通信时,为确保数据在传输过程中的安全性,可使用 HTTPS 连接。以下代码展示了如何创建一个安全的 HTTPS 连接:
# Create a connection object if USE_HTTPS: ctx = SSL.Context() # Verify that the server chains to a known CA. # We hardcode cacerts.pem in the source directory # with GTE CyberTrust's certs which is what # Windows Azure chains to currently. ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) # GTE's certs are kept in cacerts.pem in the same directory # as source. sys.path[0] always # contains the directory in which the source file exists if ctx.load_verify_locations(sys.path[0] + "/cacerts.pem")!=1: raise Exception("No CA certs") # Th