Package com.adyen.httpclient
Class TerminalLocalAPIHostnameVerifier
- java.lang.Object
-
- com.adyen.httpclient.TerminalLocalAPIHostnameVerifier
-
- All Implemented Interfaces:
HostnameVerifier
public final class TerminalLocalAPIHostnameVerifier extends Object implements HostnameVerifier
A custom HostnameVerifier implementation for verifying SSL connections to Adyen Terminal Local APIs. This verifier ensures the peer certificate's common name (CN) matches expected patterns based on the current Environment.This is typically used to verify secure connections to payment terminals on local networks.
It validates the hostname by inspecting the leaf certificate (first in the chain) and checking it against allowed CNs using TerminalCommonNameValidator.
- See Also:
TerminalCommonNameValidator,Environment
-
-
Constructor Summary
Constructors Constructor Description TerminalLocalAPIHostnameVerifier(Environment environment)Constructs a newTerminalLocalAPIHostnameVerifierwith the specified environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanverify(String hostname, SSLSession session)Verifies the hostname of an SSL session by inspecting the peer's certificate and validating its common name against expected values for the given environment.
-
-
-
Constructor Detail
-
TerminalLocalAPIHostnameVerifier
public TerminalLocalAPIHostnameVerifier(Environment environment)
Constructs a newTerminalLocalAPIHostnameVerifierwith the specified environment.- Parameters:
environment- The Adyen environment used for validating terminal hostnames.
-
-
Method Detail
-
verify
public boolean verify(String hostname, SSLSession session)
Verifies the hostname of an SSL session by inspecting the peer's certificate and validating its common name against expected values for the given environment.- Specified by:
verifyin interfaceHostnameVerifier- Parameters:
hostname- the hostname to verify.session- the SSL session associated with the connection.- Returns:
trueif the hostname is valid for the given environment;falseotherwise.
-
-