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 Object implements CertificateChallenge
The Challenge 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 Details

    • 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 Details

    • Challenge

      public Challenge(BodyObserver observer, Entity entity)
      Constructor for the Challenge 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 transaction
      entity - this entity containing the request data
  • Method Details

    • challenge

      public Future<Certificate> challenge() throws 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 interface CertificateChallenge
      Parameters:
      completion - task to be run on successful challenge
      Returns:
      this future containing the original certificate
      Throws:
      Exception
    • challenge

      public Future<Certificate> challenge(Runnable completion) throws 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 interface CertificateChallenge
      Parameters:
      completion - task to be run on successful challenge
      Returns:
      this future containing the original certificate
      Throws:
      Exception