If we have the following scenario:
- a Ubuntu 18.04.5 LTS machine
- a third party server running on port
10000
of this machine and already configuring a self-signedcertificate
(https://localhost:10000) - a ngrok
tcp
tunnel exposing port10000
to the world (https://0.tcp.ngrok.io:1234/)
How can we configure an Apache httpd server in a way that only the clients with the same certificate will be able to access and see the contents of the ngrok public url (https://0.tcp.ngrok.io:1234/)?
Some of the things I tried were:
- Copying the certificate to
/etc/apache2/ssl
- Enabling the ssl module with
a2enmod ssl
- Configuring the
/etc/apache2/sites-available/000-default.conf
to have a section like:
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/cert.pem
SSLCertificateKeyFile /etc/apache2/ssl/key.pem
SSLVerifyClient require
SSLCACertificatePath /etc/ssl/certs
SSLCACertificateFile /etc/apache2/ssl/cert.pem
SSLCADNRequestFile /etc/apache2/ssl/cert.pem
SSLVerifyDepth 1
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
- Restarting the apache server
service apache2 restart
But unfortunately this is not working yet. Should I change the strategy to something different?