robputt/Py-DNS-over-HTTPS-Proxy

SSLError: EOF occurred in violation of protocol

Closed this issue · 8 comments

Hi,

Recently I get this error a lot :

Exception happened during processing of request from ('127.0.0.1', 51524)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 599, in process_request_thread
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 655, in init
self.handle()
File "/Library/Python/2.7/site-packages/dnslib/server.py", line 144, in handle
rdata = self.get_reply(data)
File "/Library/Python/2.7/site-packages/dnslib/server.py", line 161, in get_reply
reply = resolver.resolve(request,self)
File "dns.py", line 108, in resolve
verify=False)
File "/Library/Python/2.7/site-packages/requests/api.py", line 70, in get
return request('get', url, params=params, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 475, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 596, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 497, in send
raise SSLError(e, request=request)
SSLError: EOF occurred in violation of protocol (_ssl.c:590)

@robputt796

the WARNING: REMOTE SSL CERT DID NOT MATCH EXPECTED happened again besides what i post for new error i received

SSL Cert Mismatch in Issue #4

Hi @arminmacx,

Can you provide a "pip freeze" of your Python environment you are running this in, and also the version of OpenSSL / LibSSL you have installed?

Best Regards,

Rob

all pip freeze i have :
altgraph==0.10.2
appdirs==1.4.0
argh==0.26.2
backports-abc==0.5
backports.ssl-match-hostname==3.5.0.1
bdist-mpkg==0.5.0
blinker==1.4
bonjour-py==0.3
brotlipy==0.6.0
certifi==2017.1.23
cffi==1.9.1
click==6.7
ConfigArgParse==0.11.0
construct==2.5.3
cryptography==1.5.3
cssutils==1.0.1
dns-over-https==0.0.2
dnslib==0.9.7
dnspython==1.15.0
EditorConfig==0.12.1
enum34==1.1.6
Flask==0.11.1
h2==2.4.3
hpack==2.3.0
html2text==2016.9.19
hyperframe==4.0.1
idna==2.2
ipaddr==2.1.11
ipaddress==1.0.18
ipwhois==0.15.0
itsdangerous==0.24
Jinja2==2.9.5
jsbeautifier==1.6.4
lxml==3.6.0
macholib==1.5.1
MarkupSafe==0.23
matplotlib==1.3.1
modulegraph==0.10.4
numpy==1.8.0rc1
passlib==1.6.5
pathtools==0.1.2
peewee==2.8.5
Pillow==3.4.2
py2app==0.7.3
pyasn1==0.1.9
pycparser==2.17
pyobjc-core==2.5.1
pyobjc-framework-Accounts==2.5.1
pyobjc-framework-AddressBook==2.5.1
pyobjc-framework-AppleScriptKit==2.5.1
pyobjc-framework-AppleScriptObjC==2.5.1
pyobjc-framework-Automator==2.5.1
pyobjc-framework-CFNetwork==2.5.1
pyobjc-framework-Cocoa==2.5.1
pyobjc-framework-Collaboration==2.5.1
pyobjc-framework-CoreData==2.5.1
pyobjc-framework-CoreLocation==2.5.1
pyobjc-framework-CoreText==2.5.1
pyobjc-framework-DictionaryServices==2.5.1
pyobjc-framework-EventKit==2.5.1
pyobjc-framework-ExceptionHandling==2.5.1
pyobjc-framework-FSEvents==2.5.1
pyobjc-framework-InputMethodKit==2.5.1
pyobjc-framework-InstallerPlugins==2.5.1
pyobjc-framework-InstantMessage==2.5.1
pyobjc-framework-LatentSemanticMapping==2.5.1
pyobjc-framework-LaunchServices==2.5.1
pyobjc-framework-Message==2.5.1
pyobjc-framework-OpenDirectory==2.5.1
pyobjc-framework-PreferencePanes==2.5.1
pyobjc-framework-PubSub==2.5.1
pyobjc-framework-QTKit==2.5.1
pyobjc-framework-Quartz==2.5.1
pyobjc-framework-ScreenSaver==2.5.1
pyobjc-framework-ScriptingBridge==2.5.1
pyobjc-framework-SearchKit==2.5.1
pyobjc-framework-ServiceManagement==2.5.1
pyobjc-framework-Social==2.5.1
pyobjc-framework-SyncServices==2.5.1
pyobjc-framework-SystemConfiguration==2.5.1
pyobjc-framework-WebKit==2.5.1
pyOpenSSL==16.2.0
pyparsing==2.1.10
pyperclip==1.5.27
python-dateutil==1.5
pytz==2013.7
PyYAML==3.12
requests==2.11.1
scipy==0.13.0b1
shadowsocks==2.0.4
singledispatch==3.4.0.3
six==1.10.0
tornado==4.4.2
typing==3.5.2.2
urllib3==1.20
urwid==1.3.1
vboxapi==1.0
watchdog==0.8.3
websocket-server==0.4
Werkzeug==0.11.15
xattr==0.6.4
zope.interface==4.1.1

openssl version :
OpenSSL 0.9.8zh 14 Jan 2016

Hi,

Can you try doing this in your Python env...

pip install ndg-httpsclient

if it is the system env remember todo

sudo pip install ndg-httpsclient

And then try running the proxy again and let me know if the errors you see reduce / go away.

Best Regards,

Rob

As i run the proxy with new SSL the error is go away but it's need to be active for while then its gonna show me if there is an error or not.

But I'll install what you gave me too to be sure.

Ok, please let me know if it fixes the issue.

Best Regards,

Rob

It's 24 hour after you update SSL and I ran the script and so far there isn't any error that i mentioned in first post appeared. I think it related to the SSL that expired