@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class DefaultHostnameVerifier extends Object implements HostnameVerifier
This code is based on Kevin Locke's guide .
Constructor and Description |
---|
DefaultHostnameVerifier()
A hostname verifier that uses the {{sun.security.util.HostnameChecker}} under the hood.
|
DefaultHostnameVerifier(HostnameChecker checker)
A hostname verifier that takes an external hostname checker.
|
DefaultHostnameVerifier(HostnameChecker checker,
HostnameVerifier extraHostnameVerifier)
A hostname verifier with a hostname checker, that falls back to another hostname verifier if not found.
|
DefaultHostnameVerifier(HostnameVerifier extraHostnameVerifier)
A hostname verifier that falls back to another hostname verifier if not found.
|
Modifier and Type | Method and Description |
---|---|
boolean |
verify(String hostname,
SSLSession session)
Verifies the hostname against the peer certificates in a session.
|
public DefaultHostnameVerifier()
public DefaultHostnameVerifier(HostnameChecker checker)
checker
- a hostnamechecker.public DefaultHostnameVerifier(HostnameVerifier extraHostnameVerifier)
extraHostnameVerifier
- another hostname verifier.public DefaultHostnameVerifier(HostnameChecker checker, HostnameVerifier extraHostnameVerifier)
checker
- a custom HostnameChecker.extraHostnameVerifier
- another hostname verifier.public boolean verify(String hostname, SSLSession session)
verify
in interface HostnameVerifier
hostname
- the IP address or hostname of the expected server.session
- the SSL session containing the certificates with the ACTUAL hostname/ipaddress.Copyright © 2012–2017. All rights reserved.