Package org.simpleframework.http.core
Class RequestCertificate.Challenge
- java.lang.Object
-
- org.simpleframework.http.core.RequestCertificate.Challenge
-
- All Implemented Interfaces:
CertificateChallenge
- Enclosing class:
- RequestCertificate
private static class RequestCertificate.Challenge extends java.lang.Object implements CertificateChallenge
TheChallenge
provides a basic wrapper around the challenge provided by the SSL connection. It is used to enforce the workflow required by HTTP, this workflow requires that the SSL renegotiation be issued before the response is sent. This will also throw an exception if a challenge is issued for a request that already has a client certificate.
-
-
Field Summary
Fields Modifier and Type Field Description private Certificate
certificate
This is the certificate associated with the SSL connection.private Channel
channel
This is the channel representing the underlying TCP stream.private BodyObserver
observer
This is the observer used to keep track of the HTTP transaction.
-
Constructor Summary
Constructors Constructor Description Challenge(BodyObserver observer, Entity entity)
Constructor for theChallenge
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.Future<Certificate>
challenge()
This method will challenge the client for their certificate.java.util.concurrent.Future<Certificate>
challenge(java.lang.Runnable completion)
This method will challenge the client for their certificate.
-
-
-
Field Detail
-
observer
private final BodyObserver observer
This is the observer used to keep track of the HTTP transaction.
-
certificate
private final Certificate certificate
This is the certificate associated with the SSL connection.
-
channel
private final Channel channel
This is the channel representing the underlying TCP stream.
-
-
Constructor Detail
-
Challenge
public Challenge(BodyObserver observer, Entity entity)
Constructor for theChallenge
object. This is basically a wrapper for the raw certificate challenge that will enforce some of the workflow required by HTTPS.- Parameters:
observer
- this observer used to track the transactionentity
- this entity containing the request data
-
-
Method Detail
-
challenge
public java.util.concurrent.Future<Certificate> challenge() throws java.lang.Exception
This method will challenge the client for their certificate. It does so by performing an SSL renegotiation. Successful completion of the SSL renegotiation results in the client providing their certificate, and execution of the task.- Specified by:
challenge
in interfaceCertificateChallenge
- Parameters:
completion
- task to be run on successful challenge- Returns:
- this future containing the original certificate
- Throws:
java.lang.Exception
-
challenge
public java.util.concurrent.Future<Certificate> challenge(java.lang.Runnable completion) throws java.lang.Exception
This method will challenge the client for their certificate. It does so by performing an SSL renegotiation. Successful completion of the SSL renegotiation results in the client providing their certificate, and execution of the task.- Specified by:
challenge
in interfaceCertificateChallenge
- Parameters:
completion
- task to be run on successful challenge- Returns:
- this future containing the original certificate
- Throws:
java.lang.Exception
-
-