| 1 | /* Code to support SSL connections */ |
|---|
| 2 | |
|---|
| 3 | #ifndef _MYSSL_H |
|---|
| 4 | #define _MYSSL_H |
|---|
| 5 | |
|---|
| 6 | #include "copyrite.h" |
|---|
| 7 | |
|---|
| 8 | #ifdef HAS_OPENSSL |
|---|
| 9 | |
|---|
| 10 | SSL_CTX *ssl_init(char *private_key_file, char *ca_file, int req_client_cert); |
|---|
| 11 | SSL *ssl_setup_socket(int sock); |
|---|
| 12 | void ssl_close_connection(SSL * ssl); |
|---|
| 13 | SSL *ssl_listen(int sock, int *state); |
|---|
| 14 | SSL *ssl_resume(int sock, int *state); |
|---|
| 15 | int ssl_accept(SSL * ssl); |
|---|
| 16 | int ssl_handshake(SSL * ssl); |
|---|
| 17 | int ssl_need_accept(int state); |
|---|
| 18 | int ssl_need_handshake(int state); |
|---|
| 19 | int ssl_want_write(int state); |
|---|
| 20 | int ssl_read(SSL * ssl, int state, int net_read_ready, int net_write_ready, |
|---|
| 21 | char *buf, int bufsize, int *bytes_read); |
|---|
| 22 | int ssl_write(SSL * ssl, int state, int net_read_ready, int net_write_ready, |
|---|
| 23 | unsigned char *buf, int bufsize, int *offset); |
|---|
| 24 | void ssl_write_session(FILE * fp, SSL * ssl); |
|---|
| 25 | void ssl_read_session(FILE * fp); |
|---|
| 26 | void ssl_write_ssl(FILE * fp, SSL * ssl); |
|---|
| 27 | SSL *ssl_read_ssl(FILE * fp, int sock); |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | #endif /* HAS_OPENSSL */ |
|---|
| 31 | #endif /* _MYSSL_H */ |
|---|