Skip to content

Commit a3b6632

Browse files
synthermichalvasko
authored andcommitted
session BUGFIX Fix TLS connection with Subject Alternative Name
Without the fix, it's impossible to connect to the server using client authentication based on Subject Alternative Name from a X.509 client certificate. The commit fixes the following <cert-to-name> mapping [1]: - san-rfc822-name - san-dns-name x - san-ip-address - san-any Fixes #328 Links: [1] https://datatracker.ietf.org/doc/html/rfc7407#section-4.1
1 parent 86eb9d6 commit a3b6632

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/session_server_tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ nc_tls_ctn_get_username_from_cert(X509 *client_cert, NC_TLS_CTN_MAPTYPE map_type
285285
}
286286
sk_GENERAL_NAME_pop_free(san_names, GENERAL_NAME_free);
287287

288-
if (i < san_count) {
288+
if (i == san_count) {
289289
switch (map_type) {
290290
case NC_TLS_CTN_SAN_RFC822_NAME:
291291
WRN(NULL, "Certificate does not include the SAN rfc822Name field.");

0 commit comments

Comments
 (0)