I have installed Apache on Ubuntu, installed GNUTLS module and everything worked fine:
root@ilnwad15:~# apache2 -v
Server version: Apache/2.2.22 (Ubuntu)
Server built: Jul 12 2013 13:37:15
Now, I want that on port 1443, if the CA of the client certificate is not the CA on my server, then it will be blocked.
That's how I configured it on /etc/apache2/apache2.conf
Listen *:443
Listen *:1443
<VirtualHost *:443>
GnuTLSEnable on
GnuTLSKeyFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.key
GnuTLSCertificateFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt
DocumentRoot /disk2/var/www/html
GnuTLSPriorities EXPORT
ServerName ilnwad15
</VirtualHost>
<VirtualHost *:1443>
GnuTLSEnable on
GnuTLSKeyFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.key
GnuTLSCertificateFile /etc/apache2/certs/ilnwad15.tlv.sap.corp.crt
GnuTLSPriorities EXPORT
GnuTLSClientCAFile /etc/apache2/certs/ca.pem
GNUTLSClientVerify require
DocumentRoot /disk2/var/www/html
ServerName ilnwad15
</VirtualHost>
What it does now is, when sending a request with no certificate, getting internal error.
[root@ilnwadv56 ~]# wget --save-headers --no-check-certificate HTTPs://ilnwad15.tlv.sap.corp:1443
--2013-12-18 17:23:01-- https://ilnwad15.tlv.sap.corp:1443/
Resolving ilnwadv62... 172.16.162.21
Connecting to ilnwadv62|172.16.162.21|:18080... connected.
WARNING: cannot verify ilnwad15.tlv.sap.corp's certificate, issued by `/C=IL/L=Raanana/O=SAP/OU=AccAD/CN=Dummy device':
Unable to locally verify the issuer's authority.
WARNING: certificate common name `dummy.service.com' doesn't match requested host name `ilnwad15.tlv.sap.corp'.
Proxy request sent, awaiting response... 500 Server Error
2013-12-18 17:23:01 ERROR 500: Server Error.
However, when the request has a certificate that its CA doesn't match the server CA, I get 200 OK from Internet Explorer
and no 403 Forbidden.
When doing so from wget
I am getting the failed: Service Unavailable to establish SSL connection.
[root@ilnwadv56 ~]# wget --save-headers --no-check-certificate --certificate=/sapmnt/accad/other/client.crt --private-key=/sapmnt/accad/other/client.key HTTPs://ilnwad15.tlv.sap.corp:443
--2013-12-18 17:46:17-- https://ilnwad15.tlv.sap.corp/
Resolving ilnwadv62... 172.16.162.21
Connecting to ilnwadv62|172.16.162.21|:18080... connected.
Proxy tunneling failed: Service UnavailableUnable to establish SSL connection.
Does anyone have an idea where is my mistake? Thanks in advance.