Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) #10

Open
xl7dev opened this issue Jan 25, 2017 · 12 comments

Comments

@xl7dev
Copy link

xl7dev commented Jan 25, 2017

from metasploit.msfrpc import MsfRpcClient
client = MsfRpcClient('mypassword')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/metasploit/msfrpc.py", line 207, in init
self.login(kwargs.get('username', 'msf'), password)
File "/usr/local/lib/python2.7/site-packages/metasploit/msfrpc.py", line 309, in login
r = self.call(MsfRpcMethod.AuthLogin, username, password)
File "/usr/local/lib/python2.7/site-packages/metasploit/msfrpc.py", line 224, in call
self.client.request('POST', self.uri, packb(l), self._headers)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1263, in connect
server_hostname=server_hostname)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 363, in wrap_socket
_context=self)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 611, in init
self.do_handshake()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 840, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

@JohnTroony
Copy link

Hey, what's your setup?

@xl7dev
Copy link
Author

xl7dev commented Feb 1, 2017

➜ ~ msfrpcd -P mypassword -n -f -a 127.0.0.1
[] MSGRPC starting on 127.0.0.1:55553 (SSL):Msg...
[
] MSGRPC ready at 2017-02-01 21:06:57 +0800.

from metasploit.msfrpc import MsfRpcClient
client = MsfRpcClient('mypassword')

@benkhlifafahmi
Copy link

@xl7dev try the following code

import ssl
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context`

from metasploit.msfrpc import MsfRpcClient
client = MsfRpcClient('mypassword')```

@xl7dev
Copy link
Author

xl7dev commented Oct 17, 2017

@benkhlifafahmi thanks

@devcoinfet
Copy link

I tried the above fix and I'm still getting a hang up during the basic enumeration of a exploit module.

@benkhlifafahmi
Copy link

@devcoinfet do you get the same error ??? if not please paste the new exception

@devcoinfet
Copy link

devcoinfet commented Feb 14, 2018 via email

@benkhlifafahmi
Copy link

@devcoinfet yeah i'll be glad if you share your solution via erric.oneal@gmail.com

@DanMcInerney
Copy link

I'm curious too. danhmcinerney@gmail.com

@HansDaigle
Copy link

Can you send you working version to me as well ? HansDaigle@me.com

@devcoinfet
Copy link

devcoinfet commented Apr 10, 2018 via email

@devcoinfet
Copy link

devcoinfet commented Apr 10, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants