NGINX uses client certificates (ssl_verify_client)


TDawg

I have a weird question, I don't even know how to phrase it, but I tried my best

I use laravel forge to manage my SSL via LetsEncrypt.

It generates the file:

server.crt  
server.key

How to get .pem files from .key and .crt files? Based on that link, I understand that server.crt is the same .pem as the poster asked about.

So to generate ca.pem I did the following:

cat /etc/ssl/certs/DST_Root_CA_X3.pem server.crt > ca.pem

Then in my nginx.conf I have these lines:

ssl_client_certificate /etc/nginx/ssl/domain/ca.pem;
ssl_verify_client on;  

My main goal is to use it with mqtt, following 2 guides, I achieved this setup, but sending ca.pem with my mqtt command, I get:

*77 client sent no required SSL certificate while SSL handshaking, client: 11.112.7.84, server: 11.166.22.84:8883
hard disk

This doesn't work.

You need to use your own CA to issue client certificates, you can't use LetsEncrypt's CA and server certificates to issue/verify client certificates (they should have flags set to make it impossible).

ssl_client_certificateNeeds to point to the certificate chain used to issue the client certificate presented by the client to identify itself.

The certificate used to authenticate the proxy does not need to be associated with the client certificate in any way.

Related


How to allow specific SSL client certificates in Nginx?

Joe White Nginx ssl_client_certificateand ssl_trusted_certificatedirectives can be used to allow client certificates signed by a given authority. But how to allow specific certificates? I want to filter by certificate thumbprint or by certificate authority + c

Nginx client authentication using multiple client certificates

Jonathan Nagin I'm trying to setup NGINX to perform client authentication for multiple clients. My problem is that those clients will have different certificates, basically different root CAs: [clientA.crt] ClientA > IntermediateA > RootA [clientB.crt] ClientB

Nginx client authentication using multiple client certificates

Jonathan Nagin I'm trying to setup NGINX to perform client authentication for multiple clients. My problem is that those clients will have different certificates, basically different root CAs: [clientA.crt] ClientA > IntermediateA > RootA [clientB.crt] ClientB

Nginx client authentication using multiple client certificates

Jonathan Nagin I'm trying to setup NGINX to perform client authentication for multiple clients. My problem is that those clients will have different certificates, basically different root CAs: [clientA.crt] ClientA > IntermediateA > RootA [clientB.crt] ClientB

nginx location match on ssl_client_verify

tribal star I'm trying to setup nginx to match certain URLs on servers granted conditional access (ie, only servers with valid client certificates can access the zone). Currently, simple location blocking works well to prevent access by unauthorized users: loc

nginx location match on ssl_client_verify

tribal star I'm trying to setup nginx to match certain URLs on servers granted conditional access (ie, only servers with valid client certificates can access the zone). Currently, simple location blocking works well to prevent access by unauthorized users: loc

nginx location match on ssl_client_verify

tribal star I'm trying to setup nginx to match certain URLs on servers granted conditional access (ie, only servers with valid client certificates can access the zone). Currently, simple location blocking works well to prevent access by unauthorized users: loc

Nginx and SSL certificates

Lesha Ppiev I want to provide ssl support for my website under Nginx. First, I tried to use a self-signed certificate, but as you know, the browser complains The current connection cannot be trusted Second, I tried ordering a free certificate from a reputable

Nginx and SSL certificates

Lesha Ppiev I want to provide ssl support for my website under Nginx. First, I tried to use a self-signed certificate, but as you know, the browser complains The current connection cannot be trusted Second, I tried ordering a free certificate from a reputable

OCSP revocation of client certificates

gtrak: How to manually check certificate revocation status in Java using OCSP, considering only the client's java.security.cert.X509Certificate? I can't see a clear way to do it. Alternatively, I can have tomcat do this for me automatically, how do you know yo

Client certificates and identities in iOS

lipoprotein: I have used SecKeyGeneratePairfunctions to generate private and public keys for a Swift based iOS app . I then generated a "Certificate Signing Request" using the iOS CSR and my server replied with a certificate chain in PEM format. I use the foll

Compare client certificates in go

User1791139: My use case looks like I know the client's public certificate and just want to allow them. I have a go server configured based on gin and TLS where a method has been assigned to the property "VerifyPeerCertificate". The function looks like func cu

OCSP revocation of client certificates

gtrak: How to manually check certificate revocation status in Java using OCSP, considering only the client's java.security.cert.X509Certificate? I can't see a clear way to do it. Alternatively, I can have tomcat do this for me automatically, how do you know yo

Compare client certificates in go

User1791139: My use case looks like I know the client's public certificate and just want to allow them. I have a go server configured based on gin and TLS where a method has been assigned to the property "VerifyPeerCertificate". The function looks like func cu

Client certificates and identities in iOS

lipoprotein: I have used SecKeyGeneratePairfunctions to generate private and public keys for a Swift based iOS app . I then generated a "Certificate Signing Request" using the iOS CSR and my server replied with a certificate chain in PEM format. I use the foll

Dynamically request client certificates

user 93353 The web server has settings for requesting client certificates - eg. SSLVerifyClient requireIn Apache, use other settings in IIS etc. If this setting is set, the browser will pop up a dialog asking you to select a certificate. Is it possible to requ

Android and client certificates

Anthony B Code I've been searching for weeks and can't seem to find an answer anywhere. I am trying to do the following for Android. The code is from a C# app I wrote but am porting it to Android. Web endpoints require certificates to be attached to mutual aut

Android and client certificates

Anthony B Code I've been searching for weeks and can't seem to find an answer anywhere. I am trying to do the following for Android. The code is from a C# app I wrote but am porting it to Android. Web endpoints require certificates to be attached to mutual aut

OCSP revocation of client certificates

gtrak: How to manually check certificate revocation status in Java using OCSP, considering only the client's java.security.cert.X509Certificate? I can't see a clear way to do it. Alternatively, I can have tomcat do this for me automatically, how do you know yo

Compare client certificates in go

User1791139: My use case looks like I know the client's public certificate and just want to allow them. I have a go server configured based on gin and TLS where a method has been assigned to the property "VerifyPeerCertificate". The function looks like func cu

Client certificates and identities in iOS

lipoprotein: I have used SecKeyGeneratePairfunctions to generate private and public keys for a Swift based iOS app . I then generated a "Certificate Signing Request" using the iOS CSR and my server replied with a certificate chain in PEM format. I use the foll

Dynamically request client certificates

user 93353 The web server has settings for requesting client certificates - eg. SSLVerifyClient requireIn Apache, use other settings in IIS etc. If this setting is set, the browser will pop up a dialog asking you to select a certificate. Is it possible to requ

Disable SSL client certificates on *some* WebAPI controllers?

Deep Space 101 Edit for future readers : Unfortunately, the bounty awarded answer doesn't work;there's nothing I can do about it right now. But please read my own answer below (by testing) - confirmed to work with minimal code changes We have an Azure cloud se

Disable SSL client certificates on *some* WebAPI controllers?

Deep Space 101 Edit for future readers : Unfortunately, the bounty awarded answer doesn't work;there's nothing I can do about it right now. But please read my own answer below (by testing) - confirmed to work with minimal code changes We have an Azure cloud se

Disable SSL client certificates on *some* WebAPI controllers?

Deep Space 101 Edit for future readers : Unfortunately, the bounty awarded answer doesn't work;there's nothing I can do about it right now. But please read my own answer below (by testing) - confirmed to work with minimal code changes We have an Azure cloud se

Client-Side SSL with Intermediate Certificates

Naftuli Kay I have a self signed root certificate and an intermediate certificate signed by that root. Basically something like this: . └── master (CA) └── servant1 (CA) I have some client certificates from master->servant1certificate chain : . └── master