Uploaded image for project: 'BrownDog'
  1. BrownDog
  2. BD-2277

Fix SSL related errors getting from RabbitMQ VM

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 0.6 - Dalmatian
    • 0.4 - Boxer
    • None
    • None

      Currently, when trying to access RabbitMQ management URL or API from Python requests, it's resulting in SSL certificate validation errors. As part of this task,  this issue needs to be investigated and fixed in RabbitMQ VM or at some other appropriate place(s).

      Pasting the stack trace from running Extractor fetcher info:

       

      [2018-10-03 14:37:04,481] ERROR in app: Exception on /get-extractors-info [GET]
      Traceback (most recent call last):
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
          response = self.full_dispatch_request()
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
          rv = self.handle_user_exception(e)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
          return cors_after_request(app.make_response(f(*args, **kwargs)))
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
          reraise(exc_type, exc_value, tb)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
          rv = self.dispatch_request()
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
          return self.view_functions[rule.endpoint](**req.view_args)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/extractor-info-fetcher.py", line 37, in get_extractor_info
          verify=rabbitmq_ssl_verify)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/requests/api.py", line 70, in get
          return request('get', url, params=params, **kwargs)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/requests/api.py", line 56, in request
          return session.request(method=method, url=url, **kwargs)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
          resp = self.send(prep, **send_kwargs)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
          r = adapter.send(request, **kwargs)
        File "/Users/sandeep/Repositories/BD/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
          raise SSLError(e, request=request)
      SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)

      This issue can be replicated by doing a Python requests Get call as below from any Python console:

      import requests
       
      response = requests.get("https://rabbitmq.ncsa.illinois.edu:15672")

       

      The output of running the above command in bd-clowder.ncsa.illinois.edu:

      Python 3.5.2 (default, Nov 12 2018, 13:43:14) 
      [GCC 5.4.0 20160609] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import requests
      >>> response = requests.get("https://rabbitmq.ncsa.illinois.edu:15672")
      Traceback (most recent call last):
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen
          chunked=chunked)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request
          self._validate_conn(conn)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn
          conn.connect()
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 323, in connect
          ssl_context=context)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py", line 324, in ssl_wrap_socket
          return context.wrap_socket(sock, server_hostname=server_hostname)
        File "/usr/lib/python3.5/ssl.py", line 377, in wrap_socket
          _context=self)
        File "/usr/lib/python3.5/ssl.py", line 752, in __init__
          self.do_handshake()
        File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake
          self._sslobj.do_handshake()
        File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake
          self._sslobj.do_handshake()
      ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
       
       
      During handling of the above exception, another exception occurred:
       
       
      Traceback (most recent call last):
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
          timeout=timeout
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 624, in urlopen
          raise SSLError(e)
      requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
       
       
      During handling of the above exception, another exception occurred:
       
       
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/api.py", line 70, in get
          return request('get', url, params=params, **kwargs)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/api.py", line 56, in request
          return session.request(method=method, url=url, **kwargs)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
          resp = self.send(prep, **send_kwargs)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
          r = adapter.send(request, **kwargs)
        File "/home/browndog/bd-aux-services/extractor-info-fetcher/prototype-endpoint-env/lib/python3.5/site-packages/requests/adapters.py", line 497, in send
          raise SSLError(e, request=request)
      requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
      

              sandeeps Sandeep Puthanveetil Satheesan
              sandeeps Sandeep Puthanveetil Satheesan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: