Class TLSContext
- java.lang.Object
-
- net.webpdf.wsclient.session.connection.https.TLSContext
-
public class TLSContext extends Object
An instance of
TLSContextprepares aTLSProtocolcontext for encrypted HTTPS connections.Information: TLS is the follow up protocol of the (better known) SSL (Secure Socket Layer) protocol - SSL is no longer supported by the webPDF wsclient, as it is obsolete and insecure.
Be aware: An implementation of
TLSContextis not required to serve multipleSessions at a time. It is expected to create a newTLSContextfor each existingSession(That shall use HTTPS).
-
-
Constructor Summary
Constructors Constructor Description TLSContext()Prepares a fresh theTLSContextfor an HTTPS connection.
This empty default constructor defaults toTLSProtocol.TLSV1_3, does not allow self-signedX509Certificates and will not configure a truststore.TLSContext(@NotNull TLSProtocol tlsProtocol, boolean allowSelfSigned)Prepares a fresh theTLSContextfor an HTTPS connection.TLSContext(@NotNull TLSProtocol tlsProtocol, boolean allowSelfSigned, @NotNull File trustStore, @Nullable String trustStorePassword)Prepares a fresh theTLSContextfor an HTTPS connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull SSLContextcreate()Returns (and/or initializes) theSession´sSSLContext.@NotNull TLSProtocolgetTlsProtocol()Returns the selectedTLSProtocol.@Nullable FilegetTrustStore()Returns the selectedX509Certificatetruststore file@Nullable StringgetTrustStorePassword()Returns the password for the selectedX509Certificatetruststore filebooleanisAllowSelfSigned()Returnstrue, if self-signedX509Certificates shall be accepted.
-
-
-
Constructor Detail
-
TLSContext
public TLSContext(@NotNull @NotNull TLSProtocol tlsProtocol, boolean allowSelfSigned, @NotNull @NotNull File trustStore, @Nullable @Nullable String trustStorePassword)Prepares a fresh the
TLSContextfor an HTTPS connection.Sets the
X509Certificatetruststore file and it´s password. The truststore shall determine which connection targets shall be deemed trustworthy.- Parameters:
trustStore- Selects theX509Certificatetruststore filetrustStorePassword- Selects a possibly necessary password for the truststore file.allowSelfSigned- Set totrueto allow the usage of self-signedX509Certificates.tlsProtocol- TheTLSProtocol, that shall be used.
-
TLSContext
public TLSContext(@NotNull @NotNull TLSProtocol tlsProtocol, boolean allowSelfSigned)Prepares a fresh theTLSContextfor an HTTPS connection.- Parameters:
tlsProtocol- TheTLSProtocol, that shall be used.allowSelfSigned- Set totrueto allow the usage of self-signedX509Certificates.
-
TLSContext
public TLSContext()
Prepares a fresh theTLSContextfor an HTTPS connection.
This empty default constructor defaults toTLSProtocol.TLSV1_3, does not allow self-signedX509Certificates and will not configure a truststore.
-
-
Method Detail
-
isAllowSelfSigned
public boolean isAllowSelfSigned()
Returnstrue, if self-signedX509Certificates shall be accepted.- Returns:
true, if self-signedX509Certificates shall be accepted.
-
getTlsProtocol
@NotNull public @NotNull TLSProtocol getTlsProtocol()
Returns the selectedTLSProtocol.- Returns:
- The selected
TLSProtocol.
-
getTrustStore
@Nullable public @Nullable File getTrustStore()
Returns the selectedX509Certificatetruststore file- Returns:
- the selected
X509Certificatetruststore file
-
getTrustStorePassword
@Nullable public @Nullable String getTrustStorePassword()
Returns the password for the selectedX509Certificatetruststore file- Returns:
- The password for the selected
X509Certificatetruststore file
-
create
@NotNull public @NotNull SSLContext create() throws ResultException
Returns (and/or initializes) the
Session´sSSLContext.Information: Actually this is not exactly a "SSL" context, but a "TLS" context. TLS is the follow up protocol of the (better known) SSL (Secure Socket Layer) protocol - SSL is no longer supported by the webPDF wsclient, as it is obsolete and insecure.
- Returns:
- The resulting
SSLContext. - Throws:
ResultException
-
-