2

We have HTTPS test server with a self-signed SSL certificate. Is there any reverse proxy that will enable us to visit the page in HTTP, so our program can send HTTP request and not an HTTPS request??

5

You can do it with apache.

First, you need to load the ssl, proxy, proxy_http and proxy_html modules.

Then, you need a proxy setting like this:

<VirtualHost 0.0.0.0:80>
    ServerName give_it_a_name

    SSLProxyEngine on

    ProxyPass / https://your-test-server/
    ProxyPassReverse / https://your-test-server/

    ErrorLog /the/error.log
</VirtualHost>

Of course you don't need a VirtualHost for this, you can embed the ProxyPass* and the SSLProxy* directives to any other host definition.

Note that the certificate has to be signed by a trusted authority. If you use self-signed certificates, you have to supply them using the

SSLProxyCACertificateFile /the/pem/file

or the

SSLProxyCACertificatePath /the/dir/where/the/cert/files/are

directives.

Also, Apache checks if the name of the remote host is the same as the one the certificate issued to. You can disable this behavior by adding the

SSLProxyCheckPeerCN off

line to your config. For further settings, you may want to check the Apache docs.

1

If your test server has HTTP enabled you can simply proxy to that protocol (assuming apache and mod_rewrite):

RewriteEngine On
RewriteRule ^/foo(.*)$ http://testserver.example.org/$1 [P]

If there's nothing listening on the unencrypted HTTP port you can't just strip the SSL away.

1
RewriteEngine On
RewriteRule ^/foo(.*)$  https://%{HTTP_HOST}%{REQUEST_URI} [R]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.