Skip to content

Commit

Permalink
removing check for isGoodDNSName() in OL, will still be used in CL (O…
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwdv authored Jul 12, 2024
1 parent 11d1303 commit 00b518b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-2.0/
*
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
Expand Down Expand Up @@ -322,9 +322,7 @@ public String defaultExtInfo() {
if (addr != null && addr.toString().startsWith("/"))
ext += "ip:" + hostname;
else {
// If the hostname start with a digit keytool will not create a SAN with the value
if (!Character.isDigit(hostname.charAt(0)))
ext += "dns:" + hostname;
ext += "dns:" + hostname;
}
String ipAddresses = buildSanIpStringFromNetworkInterface();
if (ipAddresses != null)
Expand Down Expand Up @@ -386,9 +384,9 @@ private static String buildSanIpStringFromNetworkInterface() {
* This method acts like a filter for xml snippets. If the user provides the {@link #ARG_OPT_CREATE_CONFIG_FILE} option, then we will write it to a file and
* provide an include snippet. Otherwise, we just return the provided xml snippet.
*
* @param serverDir Path to the root of the server. e.g. /path/to/wlp/usr/servers/myServer/
* @param serverDir Path to the root of the server. e.g. /path/to/wlp/usr/servers/myServer/
* @param commandLine The command-line arguments.
* @param xmlSnippet The xml configuration the task produced.
* @param xmlSnippet The xml configuration the task produced.
* @return An include snippet or the given xmlSnippet.
*/
protected String createConfigFileIfNeeded(String serverDir, String[] commandLine, String xmlSnippet) {
Expand Down
10 changes: 3 additions & 7 deletions dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -1814,23 +1814,19 @@ private String createCertSANInfo(String hostname) {
if (hostname != null && !hostname.isEmpty()) {
if (hostname.equals("localhost")) {
String host = InetAddress.getLocalHost().getCanonicalHostName();
if (isGoodDNSName(host))
san.add("dns:" + host);
san.add("dns:" + host);
}
InetAddress addr;
// get the InetAddress if there is one
addr = getInetAddress(hostname);
if (addr != null && addr.toString().startsWith("/"))
san.add("ip:" + hostname);
else {
// If the hostname start with a digit keytool will not create a SAN with the value
if (isGoodDNSName(hostname))
san.add("dns:" + hostname);
san.add("dns:" + hostname);
}
} else {
String host = InetAddress.getLocalHost().getCanonicalHostName();
if (isGoodDNSName(host))
san.add("dns:" + host);
san.add("dns:" + host);
}
String ipAddresses = buildSanIpStringFromNetworkInterface();
if (ipAddresses != null)
Expand Down

0 comments on commit 00b518b

Please sign in to comment.