napalm-automation-community / napalm-asa

napalm-asa
Apache License 2.0
17 stars 13 forks source link

Unable to open connection to ASAv #25

Closed gladpark closed 6 years ago

gladpark commented 6 years ago

Hello, Really appreciate the work you've put into this project. But I can't seem to get past open(). I get the error below.. I'm trying to connect to an ASAv on VIRL. Is there something I'm missing? Thanks!

`driver_asa = napalm.get_network_driver('asa') a = driver_asa('172.16.1.134', 'cisco', "cisco", optional_args={'secret': 'cisco', 'port': 22}) a.open() Traceback (most recent call last): File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn conn.connect() File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/connection.py", line 356, in connect ssl_context=context) File "/home/gladpark/NET_TOOLSENV/lib/python3.6/site-packages/urllib3/util/ssl.py", line 372, in ssl_wrap_socket return context.wrap_socket(sock) File "/usr/lib64/python3.6/ssl.py", line 407, in wrap_socket _context=self, _session=session) File "/usr/lib64/python3.6/ssl.py", line 814, in init self.do_handshake() File "/usr/lib64/python3.6/ssl.py", line 1068, in do_handshake self._sslobj.do_handshake() File "/usr/lib64/python3.6/ssl.py", line 689, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:841)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/requests/adapters.py", line 445, in send timeout=timeout File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='172.16.1.134', port=22): Max retries exceeded with url: /api/tokenservices (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:841)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/napalm_asa/asa.py", line 65, in get_auth_token data="", timeout=self.timeout, verify=False) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/requests/sessions.py", line 559, in post return self.request('POST', url, data=data, json=json, kwargs) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/requests/sessions.py", line 512, in request resp = self.send(prep, send_kwargs) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/requests/sessions.py", line 622, in send r = adapter.send(request, **kwargs) File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/requests/adapters.py", line 511, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='172.16.1.134', port=22): Max retries exceeded with url: /api/tokenservices (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:841)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/napalm_asa/asa.py", line 185, in open auth_result, code = self._authenticate() File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/napalm_asa/asa.py", line 131, in _authenticate auth_result = self.device.get_auth_token() File "/home/gladpark/NET_TOOLS_ENV/lib/python3.6/site-packages/napalm_asa/asa.py", line 73, in get_auth_token raise ConnectionException(py23_compat.text_type(e)) napalm.base.exceptions.ConnectionException: HTTPSConnectionPool(host='172.16.1.134', port=22): Max retries exceeded with url: /api/tokenservices (Caused by SSLError(SSLError(1, '[SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:841)'),))`

gladpark commented 6 years ago

Sorry realized this is using REST API and it's not enabled on the ASAv. Closing