lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #ifndef _h_websSSL |
| 2 | #define _h_websSSL 1 |
| 3 | |
| 4 | |
| 5 | #ifdef OPENSSL |
| 6 | #define SSLEAY |
| 7 | #define USE_SOCKETS |
| 8 | #include <openssl/ssl.h> |
| 9 | #else |
| 10 | #include <sslc.h> |
| 11 | #endif |
| 12 | |
| 13 | #ifndef UEMF |
| 14 | #include "basic/basic.h" |
| 15 | #include "emf/emf.h" |
| 16 | #else |
| 17 | #include "uemf.h" |
| 18 | #endif |
| 19 | |
| 20 | typedef struct { |
| 21 | SSL *ssl; |
| 22 | BIO *bio; |
| 23 | } websSSL_t; |
| 24 | |
| 25 | |
| 26 | extern int websSSLIsOpen(); |
| 27 | |
| 28 | extern int websSSLGets(websSSL_t *wsp, char_t **buf); |
| 29 | extern int websSSLRead(websSSL_t *wsp, char_t *buf, int nChars); |
| 30 | extern int websSSLWrite(websSSL_t *wsp, char_t *buf, int nChars); |
| 31 | |
| 32 | extern int websSSLOpen(); |
| 33 | extern void websSSLClose(); |
| 34 | |
| 35 | extern int websSSLEof(websSSL_t *wsp); |
| 36 | |
| 37 | extern int websSSLFlush(websSSL_t *wsp); |
| 38 | extern int websSSLFree(websSSL_t *wsp); |
| 39 | |
| 40 | extern int websSSLSetKeyFile(char_t *keyFile); |
| 41 | extern int websSSLSetCertFile(char_t *certFile); |
| 42 | |
| 43 | |
| 44 | #endif /* _h_websSSL */ |
| 45 | |