Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7472-Hostname verification-Dvd-cmts-1 #7536

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/pages/troubleshooting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ Exception thrown while trying to read configuration and update ManagedServiceFac
This error occurs when a keystore element exists in the configuration without an ID field.
If you use a minimal TLS configuration, set the `ID` field to `defaultKeyStore`.

[#hostverify]
=== You receive the CWPKI0824E message that SSL handshake failure due to hostname verification error

If you try to access a URL, you might see the following message.
Expand Down
20 changes: 17 additions & 3 deletions modules/reference/pages/feature/transportSecurity/examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,25 @@ cert_defaultKeyStore="-----BEGIN CERTIFICATE-----
[#hostverify]
=== Hostname and IP address verification

In Open Liberty, hostname and IP address verification are enabled by default. This verification is enforced for target servers in all SSL connections through Open Liberty socket factories. However, you can specify a list of hostnames, IP addresses, or both to skip verification.
Hostname and IP address verification are enabled by default. This verification is enforced for target servers in all SSL connections through Open Liberty socket factories. However, you can specify a list of hostnames, IP addresses, or both to skip verification.

To disable hostname verification entirely, set the `verifyHostname` attribute within the `ssl` tag to `false`.

[source,xml]
----
<ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" trustStoreRef="defaultTrustStore" verifyHostname="false"/>
----

When hostname verification is enabled, you can skip verification for hostnames or IP addresses that are specified in the `skipHostnameVerificationForHosts` attribute within the `ssl` tag.

[source,xml]
----
<ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" trustStoreRef="defaultTrustStore" skipHostnameVerificationForHosts="myHost.com"/>
----

The verification makes sure that the hostname or IP address in the URL matches the Subject Alternative Name (SAN) in the SSL certificate of the server. If the SAN is not found, the property makes sure that the hostname in the URL matches the Common Name (CN). If a mismatch exists, the SSL connection is rejected.

Typically, during hostname verification, when the hostname is used in the request, it checks against the DNSName entry in the SAN. If the SAN does not contain a DNSName entry, hostname verification uses the certificate owner's common name (CN). When an IP address is used in the request, hostname verification relies on the IP address information in the SAN only.
Typically, during hostname verification, when the hostname is used in the request, it checks against the `DNSName` entry in the SAN. If the SAN does not contain a `DNSName` entry, hostname verification uses the certificate owner's Common Name (CN). When an IP address is used in the request, hostname verification relies on the IP address information in the SAN only.

For more information, see xref:pages/troubleshooting.adoc#Troubleshooting_SSL[Troubleshooting SSL and TLS]
For more information, see xref:ROOT/troubleshooting.adoc#Troubleshooting_SSL[Troubleshooting SSL and TLS]