Adds session to the session cache.
Initiates the SSL/TLS handshake as a server in non-blocking manner.
# emulates blocking accept begin ssl.accept_nonblock rescue IO::WaitReadable IO.select([s2]) retry rescue IO::WaitWritable IO.select(nil, [s2]) retry end
By specifying a keyword argument exception to false
, you can indicate that accept_nonblock
should not raise an IO::WaitReadable
or IO::WaitWritable
exception, but return the symbol :wait_readable
or :wait_writable
instead.
Writes string to the SSL
connection in a non-blocking manner. Raises an SSLError
if writing would block.
Returns the ALPN protocol string that was finally selected by the server during the handshake.
Returns the protocol string that was finally selected by the client during the handshake.
Parses the string representation of a distinguished name. Two different forms are supported:
OpenSSL format (X509_NAME_oneline()
) used by #to_s
. For example: /DC=com/DC=example/CN=nobody
OpenSSL format (X509_NAME_print()
) used by #to_s(OpenSSL::X509::Name::COMPAT)
. For example: DC=com, DC=example, CN=nobody
Neither of them is standardized and has quirks and inconsistencies in handling of escaped characters or multi-valued RDNs.
Use of this method is discouraged in new applications. See Name.parse_rfc2253
and to_utf8
for the alternative.
Returns the human readable error string corresponding to the error code retrieved by error
.
See also the man page X509_verify_cert_error_string(3).
The long name of the ObjectId
, as defined in <openssl/objects.h>.
Adds a nonce to the OCSP
request. If no nonce is given a random one will be generated.
The nonce is used to prevent replay attacks but some servers do not support it.
Checks the nonce validity for this request and response.
The return value is one of the following:
nonce in request only.
nonces both present and not equal.
nonces present and equal.
nonces both absent.
nonce present in response only.
For most responses, clients can check result > 0. If a responder doesn’t handle nonces result.nonzero?
may be necessary. A result of 0
is always an error.
Adds nonce to this response. If no nonce was provided a random nonce will be added.