Manipulating TLS Connections
TLS_CONNECTION *new_tls_connection (TLS_CONTEXT *ctx, int fd);
Allocates and initializes a new TLS_CONNECTION structure with context ctx and file descriptor fd.
void free_tls_connection (TLS_CONNECTION *tls);
Deallocates memory associated with the tls structure.
bool tls_bsock_connect (BSOCK *bsock);
Negotiates a a TLS client connection via bsock. Returns true if successful, false otherwise. Will fail if there is a TLS protocol error or an invalid certificate is presented
bool tls_bsock_accept (BSOCK *bsock);
Accepts a TLS client connection via bsock. Returns true if successful, false otherwise. Will fail if there is a TLS protocol error or an invalid certificate is presented.
bool tls_bsock_shutdown (BSOCK *bsock);
Issues a blocking TLS shutdown request to the peer via bsock. This function may not wait for the peer’s reply.
int tls_bsock_writen (BSOCK *bsock, char *ptr, int32_t nbytes);
Writes nbytes from ptr via the TLS_CONNECTION associated with bsock. Due to OpenSSL’s handling of EINTR, bsock is set non-blocking at the start of the function, and restored to its original blocking state before the function returns. Less than nbytes may be written if an error occurs. The actual number of bytes written will be returned.
int tls_bsock_readn (BSOCK *bsock, char *ptr, int32_t nbytes);
Reads nbytes from the TLS_CONNECTION associated with bsock and stores the result in ptr. Due to OpenSSL’s handling of EINTR, bsock is set non-blocking at the start of the function, and restored to its original blocking state before the function returns. Less than nbytes may be read if an error occurs. The actual number of bytes read will be returned.
See also
Possible Next Steps
Go back to TLS API Implementation.
Go back to TLS.
Go back to Developer Guide.
See also
Previous articles:
Next articles:
Go back to: TLS API Implementation.