SSL Errors
See original GitHub issueI am getting the following SSL erros when trying to access my internal SP site… Any ideas??
from shareplum import Site
from requests_ntlm import HttpNtlmAuth
cred = HttpNtlmAuth('domain\vennem', 'PASSWORD')
site = Site('https://sharepoint.domain.local/admin', verify_ssl=True, auth= None, ssl_version='TLSv1')
sp_list = site.List('SharePoint Business Owners and POCs')
File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\contrib\pyopenssl.py”, line 444, in wrap_socket cnx.do_handshake() File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\OpenSSL\SSL.py”, line 1915, in do_handshake self._raise_ssl_error(self._ssl, result) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\OpenSSL\SSL.py”, line 1647, in _raise_ssl_error _raise_current_error() File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\OpenSSL_util.py”, line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py”, line 600, in urlopen chunked=chunked) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py”, line 343, in _make_request self._validate_conn(conn) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py”, line 849, in validate_conn conn.connect() File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connection.py”, line 356, in connect ssl_context=context) File "C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\ssl.py", line 359, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\contrib\pyopenssl.py”, line 450, in wrap_socket raise ssl.SSLError(‘bad handshake: %r’ % e) ssl.SSLError: (“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)])”,)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\adapters.py”, line 449, in send timeout=timeout File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\connectionpool.py”, line 638, in urlopen _stacktrace=sys.exc_info()[2]) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\urllib3\util\retry.py”, line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘sharepoint.cfpb.local’, port=443): Max retries exceeded with url: /admin/_vti_bin/lists.asmx (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)])”)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “C:/Users/vennem/untitled/venv/Scripts/sharepointlist.py”, line 7, in <module> site = Site(‘https://sharepoint.cfpb.local/admin’, verify_ssl=True, auth= None, ssl_version=‘TLSv1’) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\shareplum\shareplum.py”, line 128, in init self.users = self.GetUsers() File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\shareplum\shareplum.py”, line 277, in GetUsers timeout=self.timeout) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py”, line 581, in post return self.request(‘POST’, url, data=data, json=json, **kwargs) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py”, line 533, in request resp = self.send(prep, **send_kwargs) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\sessions.py”, line 646, in send r = adapter.send(request, **kwargs) File “C:\Users\vennem\AppData\Local\Programs\Python\Python37-32\lib\site-packages\requests\adapters.py”, line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host=‘sharepoint.cfpb.local’, port=443): Max retries exceeded with url: /admin/_vti_bin/lists.asmx (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘tls_process_server_certificate’, ‘certificate verify failed’)])”)))
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (1 by maintainers)
I figured it out… i had to add next(readcsv) to skip the headers of the csv, since the field in SharePoint was a person field, it was failing because “Primary POC” wasn’t a valid person name.
Thank you so much for help guys!
Just ran it with the following and still go the UserInfoList error…
site = Site(‘https://sharepoint.cfpb.local/admin’, verify_ssl=False, auth= cred)
I figured it out… I was including the domain in my user name domain\vennem and the backslash was escaping the V.
changed itt o domain\vennem and it worked … THANK YOU FOR THE HELP