plugins: NGINX 1.34 - Web Config incorrectly assumes client certificate authentication requires a CA certificate.

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

The NGINX Web Configuration dialogs incorrectly assume that NGINX requires a Certificate Authority to use client certificate authentication/verification.

This is incorrect, NGINX does not care whether the client certificate is a self signed, only that it matches what cert is given in the config and to which depth the config says to verify to.

For example, on an NGINX config on a regular Debian server, I use a self signed certificate to identify myself for administrative access. The self signed certificate pem is on the web server and the config in the NGINX HTTP block is:

        ssl_client_certificate /etc/nginx/client_certs/admin.crt;
        ssl_verify_client on;
        ssl_verify_depth 1;

This allows NGINX to verify my self signed certificate without any CA’s present.

The configuration for OPNsense NGINX requires a CA certificate in the OPNsense System->Trust->Authorities but does not allow to choose a certificate from System->Trust->Certificates. As I said above, NGINX is capable of using a self signed/leaf certificate instead of a CA for client authentication.

Expected behavior OPNsense NGINX web configuration for the HTTP server should allow choosing a certificate from System->Trust->Certificates and specify to which depth NGINX should verify client transmitted certs as the raw NGINX configuration is already set up for.

Environment OPNsense 24.7.1 (amd64). os-nginx 1.34

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Very strange behavior. I was able to import Githubs CA without using a priv key just like you did no problem. I then generated a fresh cert with openssl using the same command I used with my admin cert: openssl req -x509 -nodes -days 3365 -newkey rsa:4096 -keyout selfsigned.key -out selfsigned.crt

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            1d:91:a7:be:f2:a4:ab:f8:97:00:67:ea:03:70:93:bb:71:ca:55:69
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = US, ST = Some-State, L = City, O = Internet Widgits Pty Ltd, OU = Section, CN = FQDN
        Validity
            Not Before: Aug 25 16:37:43 2024 GMT
            Not After : Nov 11 16:37:43 2033 GMT
        Subject: C = US, ST = Some-State, L = City, O = Internet Widgits Pty Ltd, OU = Section, CN = FQDN
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (4096 bit)
                Modulus:
                    00:eb:6d:3a:be:53:d7:0b:ae:32:39:a8:ef:4f:3e:
                    89:d0:4d:e0:4d:21:98:b9:d1:80:ff:04:9d:51:21:
                    2a:32:fb:31:d9:f3:3d:c8:c3:b7:7a:c9:de:8e:34:
                    5f:5c:a2:1f:d9:18:97:81:b7:fb:81:6e:f9:28:5c:
                    79:ef:a7:53:0b:4f:d6:04:87:e2:de:8d:de:d0:f8:
                    d5:0b:4c:c5:e6:43:7f:77:e8:1f:7b:5d:c9:b7:3e:
                    29:75:2a:dc:f0:eb:21:4e:80:9b:83:cd:09:d2:b3:
                    93:29:73:81:2e:b7:f9:51:a2:fe:60:c0:d2:51:61:
                    9c:51:86:32:3a:70:ee:64:11:f2:c4:f3:3e:75:bd:
                    62:f8:21:ab:7c:e9:6c:cd:31:28:5e:fe:91:65:b8:
                    ce:e6:c7:5f:4a:45:af:44:1b:0b:83:f5:9e:a6:b6:
                    ab:de:1f:ef:af:68:94:df:83:79:68:a6:2b:1e:10:
                    fb:b7:df:1d:f4:ba:bf:30:9a:93:ff:39:04:a6:82:
                    61:ba:c3:22:60:e1:be:63:6a:1c:0f:6a:cd:19:8f:
                    9d:8b:cf:85:74:8c:16:15:0c:38:21:13:c6:2b:4d:
                    97:99:62:2f:6e:2e:04:aa:e3:12:4d:7c:8a:34:3a:
                    bb:6b:c2:88:ca:f0:f9:51:2f:ae:c4:e2:4f:1c:56:
                    93:52:36:a9:95:6f:2b:cb:bb:e5:6d:46:6d:55:72:
                    84:44:5a:18:14:f6:8a:af:0a:28:8a:86:cd:a3:ee:
                    da:57:90:2e:09:65:3b:01:0b:4e:d2:c0:88:c9:43:
                    51:62:c4:96:c7:1f:42:35:ab:09:35:b9:b5:3e:df:
                    e1:e8:9f:f1:86:f1:4c:72:78:20:23:da:be:49:8a:
                    7b:da:f3:70:13:7d:07:82:6c:bf:7b:c1:80:36:a4:
                    ad:58:df:4d:6b:d3:d8:d8:cf:ad:67:fc:ca:18:b0:
                    0f:18:ff:8b:b8:7c:94:3f:e3:41:ad:fb:63:19:d0:
                    8f:cb:53:1b:73:f1:af:a5:06:40:30:2c:cf:11:22:
                    29:22:d0:ea:f6:b5:ec:96:c4:92:a6:bd:ff:4a:7c:
                    02:b6:30:54:15:f0:75:5c:82:84:88:b1:af:ae:95:
                    f7:6e:9e:e2:bc:ee:53:4c:34:98:1b:6b:36:91:19:
                    1f:30:50:61:c0:6d:25:d5:ad:8e:12:df:32:a3:e4:
                    db:32:73:b4:fd:36:db:94:d4:55:f3:d3:06:b1:1d:
                    79:4d:d6:53:72:b4:59:c1:3d:44:fd:b7:64:14:d7:
                    cc:bd:fd:b5:4d:21:51:0b:ec:1f:53:40:65:99:5b:
                    15:20:4e:d5:79:88:44:c0:b9:ba:0c:36:99:b2:fc:
                    0b:40:1f
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier: 
                C0:2A:51:68:B0:02:92:C0:29:06:BD:15:30:E4:DC:97:66:FC:27:5E
            X509v3 Authority Key Identifier: 
                C0:2A:51:68:B0:02:92:C0:29:06:BD:15:30:E4:DC:97:66:FC:27:5E
            X509v3 Basic Constraints: critical
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        d5:bd:46:58:b6:d9:17:28:42:a0:e2:77:71:e4:08:96:00:ac:
        d3:6d:6e:29:7d:20:87:e4:b5:d1:e2:6b:9f:78:27:e8:b2:a2:
        84:5c:5b:1b:39:c1:50:5d:be:e6:f0:96:c1:e4:b8:b5:7a:53:
        74:cc:66:72:22:bf:27:0c:50:34:fc:2e:cc:74:82:d0:b2:34:
        8d:e6:40:08:ba:f4:d4:eb:71:52:d6:ce:b3:cc:a9:a2:24:da:
        45:84:58:d5:7d:fe:68:81:f0:c9:46:94:c2:04:7a:4a:32:d3:
        5e:39:3e:3f:ab:33:9c:17:70:c3:62:d0:02:3c:ef:34:48:07:
        7c:40:b3:a2:6e:e0:2a:de:7d:dc:02:97:5c:76:e2:69:8c:9a:
        49:15:6f:2f:fe:19:a3:c8:41:83:d5:c1:44:ff:3e:b9:7a:c0:
        23:a8:98:4a:9f:e4:8f:25:3a:04:ad:d4:f5:71:50:47:e3:48:
        e1:25:9e:35:d8:61:f2:1b:bf:f6:07:1c:25:d3:35:7d:b9:c3:
        a5:38:b7:37:ef:cb:e8:f7:9b:1b:46:9c:88:ff:b6:27:76:c5:
        fc:2f:6c:1f:19:4d:7f:6e:5d:9b:25:42:b7:61:61:ce:fd:b0:
        ff:fa:a0:b4:48:53:3a:21:25:8c:f0:b9:29:d8:42:01:9e:3c:
        84:b4:33:ba:14:c6:6a:14:1b:c8:e0:16:98:b3:41:56:84:ad:
        75:58:42:8d:b0:6d:c4:ab:a8:75:1e:6c:06:01:45:ce:de:29:
        59:da:cd:79:dd:e7:02:80:72:a5:b0:56:1a:2d:40:cd:85:c1:
        91:2d:74:8c:3e:43:b6:28:5d:33:f1:20:43:ed:8d:1b:fc:8a:
        a7:97:a8:f9:59:db:f3:e9:5a:1a:a8:6e:12:a9:dd:56:70:65:
        d6:2e:e6:01:1a:26:40:a3:b2:18:1d:3a:85:f7:0a:da:15:8a:
        d1:e0:7d:50:3d:a3:fa:28:cf:0c:5e:0d:46:cb:84:6f:81:5e:
        23:14:05:c0:64:90:d9:d3:54:7d:42:2c:dd:7b:72:8a:b9:2f:
        90:33:dd:8d:da:18:e5:1a:d1:28:91:07:88:9d:18:1e:09:4e:
        71:19:15:44:b9:e4:87:84:26:ee:24:71:b7:c4:4d:6b:4c:44:
        75:89:a0:f4:dd:1d:72:f4:e5:c2:43:49:fb:c7:dd:4d:13:2e:
        38:d8:fe:d9:51:e1:2c:63:28:b9:b5:58:c3:22:65:63:3f:cd:
        84:e0:9b:bb:df:27:f1:f6:7e:b7:22:cf:e0:28:9c:43:07:ac:
        0b:2a:4e:62:90:22:21:16:3c:08:3e:fb:ac:06:78:5d:a6:2a:
        db:94:ee:23:90:2f:7d:7f

And that cert imported fine just as well.

I have no idea what the difference is between this new fresh cert and my old cert. They seem almost identical minus the Subject info.

My whole point of this issue was that I originally thought the CA import wouldn’t work for just the cert. Turns out it does work, no need for the plugin to add extra functionality!