Package org.simpleframework.http.core
Class RequestCertificate
java.lang.Object
org.simpleframework.http.core.RequestCertificate
- All Implemented Interfaces:
Certificate
The
RequestCertificate
represents a certificate for
an HTTP request. It basically wraps the raw SSL certificate that
comes with the Channel
. Wrapping the raw certificate
allows us to enforce the HTTPS workflow for SSL renegotiation,
which requires some rather weird behaviour. Most importantly
we only allow a challenge when the response has not been sent.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
TheChallenge
provides a basic wrapper around the challenge provided by the SSL connection. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Certificate
This is the raw underlying certificate for the SSL channel.private final CertificateChallenge
This is used to challenge the client for an X509 certificate.private final Channel
This is the channel representing the client connection. -
Constructor Summary
ConstructorsConstructorDescriptionRequestCertificate
(BodyObserver observer, Entity entity) Constructor for theRequestCertificate
. -
Method Summary
Modifier and TypeMethodDescriptiongetChain()
This will return the X509 certificate chain, if any, that has been sent by the client.This returns a challenge for the certificate.boolean
This is used to determine if the X509 certificate chain is present for the request.
-
Field Details
-
challenge
This is used to challenge the client for an X509 certificate. -
certificate
This is the raw underlying certificate for the SSL channel. -
channel
This is the channel representing the client connection.
-
-
Constructor Details
-
RequestCertificate
Constructor for theRequestCertificate
. This is used to create a wrapper for the raw SSL certificate that is provided by the underlying SSL session.- Parameters:
observer
- the observer used to observe the transactionentity
- the request entity containing the data
-
-
Method Details
-
getChain
This will return the X509 certificate chain, if any, that has been sent by the client. A certificate chain is typically only send when the server explicitly requests the certificate on the initial connection or when it is challenged for.- Specified by:
getChain
in interfaceCertificate
- Returns:
- this returns the clients X509 certificate chain
- Throws:
Exception
-
getChallenge
This returns a challenge for the certificate. A challenge is issued by providing aRunnable
task which is to be executed when the challenge has completed. Typically this task should be used to drive completion of an HTTPS request.- Specified by:
getChallenge
in interfaceCertificate
- Returns:
- this returns a challenge for the client certificate
- Throws:
Exception
-
isChainPresent
This is used to determine if the X509 certificate chain is present for the request. If it is not present then a challenge can be used to request the certificate.- Specified by:
isChainPresent
in interfaceCertificate
- Returns:
- true if the certificate chain is present
- Throws:
Exception
-