gpt4 book ai didi

Python3 exchangelib 连接错误 : _ssl. c :749?

转载 作者:太空宇宙 更新时间:2023-11-03 13:05:46 24 4
gpt4 key购买 nike

Python3 exchangelib 连接错误:_ssl.c:749?

我正在尝试使用 exchangelib 连接到我公司的 Exchange 服务器。我想查看我在 MS Exchange/OWA 上收到的所有邮件。

当我运行下面的代码时,我得到:

  File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "C:\Program Files\Python36\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "C:\Program Files\Python36\lib\site-packages\urllib3\connection.py", line 326, in connect
ssl_context=context)
File "C:\Program Files\Python36\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Program Files\Python36\lib\ssl.py", line 401, in wrap_socket
_context=self, _session=session)
File "C:\Program Files\Python36\lib\ssl.py", line 808, in __init__
self.do_handshake()
File "C:\Program Files\Python36\lib\ssl.py", line 1061, in do_handshake
self._sslobj.do_handshake()
File "C:\Program Files\Python36\lib\ssl.py", line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)






from exchangelib import DELEGATE, Account, Credentials,NTLM,Configuration,Version,Build
creds = Credentials(username = 'inter.com\\login',password='password')
config = Configuration(service_endpoint='https://alpha.com/EWS/Exchange.asmx',credentials=creds,auth_type=NTLM)
account = Account(primary_smtp_address='login@alpha.com',config=config,autodiscover=False,access_type=DELEGATE,verify_ssl=False)
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter

你能告诉我如何使用 exchangelib 的证书吗?

如何解决?

感谢您的帮助!

最佳答案

您是否尝试过在您的配置中禁用 ssl 验证?

config = Configuration(service_endpoint ='...', credentials=credentials, auth_type=NTLM, verify_ssl=False)

sources似乎在谈论这样一个参数。

关于Python3 exchangelib 连接错误 : _ssl. c :749?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47262056/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com