I'm trying to connect to Microsoft Exchange web server using Python and the exchangelib library. Here is my code (with edited domain, username, password and SMTP server):
from exchangelib import DELEGATE, Configuration, Credentials, Account
credentials = Credentials('MyDomain\\me@somewhere.co.uk', 'password')
config = Configuration(server='10.10.10.10', credentials=credentials)
account = Account('me@somewhere.co.uk', credentials=credentials, config=config, autodiscover=False, access_type=DELEGATE)
Trying to initiate the Account object throws this error:
Failed to create cached protocol with key ('https://10.10.10.10/EWS/Exchange.asmx',
Credentials('MyDomain\\me@somewhere.co.uk', '********')): HTTPSConnectionPool(host='10.10.10.10', port=443): Max retries exceeded with url: /EWS/Exchange.asmx (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')")))
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\cached_property.py", line 69, in __get__
return obj_dict[name]
KeyError: 'protocol'
What causes this error, and how do I fix it? Thank you.