public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* ktls-utils: question about certificate verification
@ 2024-06-20 21:44 Calum Mackay
  2024-06-21 15:33 ` Olga Kornievskaia
  0 siblings, 1 reply; 12+ messages in thread
From: Calum Mackay @ 2024-06-20 21:44 UTC (permalink / raw)
  To: Olga Kornievskaia; +Cc: Linux NFS Mailing List, Chuck Lever

hi Olga,

A few weeks ago you and Chuck were discussing duplication requirements 
of the hostname in the CN field versus SAN extension in the certificate:

	https://lore.kernel.org/linux-nfs/CAN-5tyENK71L1C=6NwdB4mkxxf1qYZ2-4e-p8FQM=SmA3tMT_g@mail.gmail.com/


For what it's worth, my own testing showed that the SAN DNS: element 
doesn't need to duplicate the CN.

This is especially relevant in the case where the full DNS name is > 64 
chars, which is not strictly allowed as a CN (and openssl for example 
enforces that limit).

In that case, it works to put the short hostname in the CN, and the full 
DNS name in a SAN DNS: extension. There is no need to duplicate the CN 
entry in the SAN extension.

I also noted that using a wildcard CN (e.g. "*.acme.com") does not work.


I've yet to test mounting by IP, but will do so soon.


best wishes,
calum.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* ktls-utils: question about certificate verification
@ 2024-05-31 17:23 Olga Kornievskaia
  2024-05-31 17:27 ` Chuck Lever III
  0 siblings, 1 reply; 12+ messages in thread
From: Olga Kornievskaia @ 2024-05-31 17:23 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

Hi Chuck,

I've ran into the following problem while trying to mount on RHEL9.4
client using xprtsec=tls. After some debugging I have determined that
the reason mount by DNS name was failing is because gnutls insisted on
having in SubjectAltName=DNS:foo.bar.com. Having a certificate that
has a DNS name in the "CN" and then had "SubjectAltName=IP:x.x.x.x"
was failing. But when I created a certificate with
"SubjectAltName:IP:x.x.x.x:DNS:x.x.x.x" then I could mount (or just
having DNS: works too but in that case mounting by IP doesn't work).

Here's the output from tlshd when it fail (with SubjectAltName "IP")::

tlshd[260035]: gnutls(3): self-signed cert found: subject
`EMAIL=kolga@netapp.com,CN=rhel94.nas.lab,OU=NFS,O=Netapp,L=Ann
Arbor,ST=MI,C=US', issuer
`EMAIL=kolga@netapp.com,CN=rhel94.nas.lab,OU=NFS,O=Netapp,L=Ann
Arbor,ST=MI,C=US', serial 0x751ad911565945cce5d29d1c206450538f496b90,
RSA key 2048 bits, signed using RSA-SHA256, activated `2024-05-31
15:07:53 UTC', expires `2024-06-30 15:07:53 UTC',
pin-sha256="Efzu7ftve1SHxBVAIwf81jwAasQ0M3j5qWbEVuM8X8I="
tlshd[260035]: gnutls(3): ASSERT: x509_ext.c[gnutls_subject_alt_names_get]:111
tlshd[260035]: gnutls(3): ASSERT: x509.c[get_alt_name]:2011
tlshd[260035]: gnutls(3): ASSERT:
verify-high.c[gnutls_x509_trust_list_verify_crt2]:1615
tlshd[260035]: gnutls(3): ASSERT: auto-verify.c[auto_verify_cb]:51
tlshd[260035]: gnutls(3): ASSERT: handshake.c[_gnutls_run_verify_callback]:3018
tlshd[260035]: gnutls(3): ASSERT:
handshake-tls13.c[_gnutls13_handshake_client]:139
tlshd[260035]: Certificate owner unexpected.

Question: is ktls-utils requirement for IP presence in SubjectAltName
now requires both?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-06-26 17:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20 21:44 ktls-utils: question about certificate verification Calum Mackay
2024-06-21 15:33 ` Olga Kornievskaia
2024-06-21 17:39   ` Calum Mackay
2024-06-25 17:31     ` Olga Kornievskaia
2024-06-25 19:48       ` Calum Mackay
2024-06-26  1:04         ` Rick Macklem
2024-06-26 13:29           ` Calum Mackay
2024-06-26 17:33             ` Olga Kornievskaia
  -- strict thread matches above, loose matches on Subject: below --
2024-05-31 17:23 Olga Kornievskaia
2024-05-31 17:27 ` Chuck Lever III
2024-05-31 17:40   ` Olga Kornievskaia
2024-05-31 18:01     ` Chuck Lever III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox