Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marteinn/509bee864704306a25db5b0feb54542d to your computer and use it in GitHub Desktop.
Save marteinn/509bee864704306a25db5b0feb54542d to your computer and use it in GitHub Desktop.

How to disable SSL verification for django-revproxy

You do this by supplying your own pool manager that disables any cert verification.

from revproxy.views import ProxyView
from urllib3 import PoolManager

class NoSSLVerifyProxyView(ProxyView):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.http = PoolManager(
            cert_reqs='CERT_NONE', assert_hostname=False
        )

urlpatterns += [
    url(r'^proxy/(?P<path>.*)$',
        NoSSLVerifyProxyView.as_view(upstream=settings.MY_UPSTREAM_URL)
    ),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment