#ifndef DONE_MYSSL
#define DONE_MYSSL 1
#include "pair.h"
#ifndef GOT_WORDLIST
typedef struct WORDLIST {char *word; struct WORDLIST *next;} Wordlist ;
#define GOT_WORDLIST 1
#endif
char *myssl_code_name(int code);
int myssl_mem_trace(void);
int myssl_report(char *domain, char *result,int size, int perdom, char *fname);
int myssl_valid(char *fname, char *reason);
Wordlist * myssl_get_ciphers(void);
int myssl_disable(char *list, int webonly, char *reason);
char *myssl_hostname(Myssl *myssl, char *bf);
int myssl_do_reload(char *reason);  // safe to call to update the contexts...
int myssl_set_domains(Wordlist *domains);
int myssl_mutex_wait(void);
void myssl_mutex_release(int line);
char *myssl_cert_file(char *tmp, char *domain, char *fname);
int myssl_exit_thread(void);
int myssl_cleanup(void);
int myssl_init_crypto(void);
int myssl_setup_dmalloc(void);
int myssl_setdir(char *dir);
int myssl_reload_ctx(char *reason);
int myssl_set_ciphers(char *xciphers);
int myssl_set_primary(char *s);
void myssl_disable_renegotiation( int x);
int myssl_set_ciphers_web(char *xciphers);
int myssl_init(char *priv_file, char *cert_file, char *reason, int (*z_imsg)(char *args,...), int (*z_emsg)(char *args,...));
int myssl_init_domains(char *priv_file, char *cert_file, Wordlist *domains, char *reason, int (*z_imsg)(char *args,...), int (*z_emsg)(char *args,...));
int myssl_set_confirm_cb(int (*cb)(char *subj, char *info));

Myssl *myssl_takeover(Chan *c, SOCKET sk, int isserver, Myssl *inherit, char *reason, int isweb, char *mstate);
Myssl *myssl_takeover_domain(Chan *c, SOCKET sk, int isserver, char *domain, Myssl *inherit, char *reason, int isweb, char *mstate);
Myssl *myssl_takeover_real(Chan *c, SOCKET sk, int require_cert, int isserver, char *domain, Myssl *inherit, char *reason,int isweb, char *mstate);
char *myssl_protocol(Myssl *m);
int myssl_read(Chan *c, Myssl *slink, char *bf, int len);
int myssl_write(Chan *c, Myssl *slink, char *bf, int len);
int myssl_wouldblock(Myssl *m);
char *myssl_lastmsg(Myssl *m);
int myssl_error(char *msg, char *reason, Myssl *ss, int *r);
int myssl_close(Chan *c,Myssl *m);
int myssl_pending(Myssl *m);
int myssl_cmp(Myssl *a, Myssl *b);
void myssl_verify_set(Myssl *m);
int myssl_load_ca(char *path);
int myssl_set_confirm_cb(int (*cb)(char *subj, char *info));
char *myssl_get_protocol_name_used(Myssl *m);
void myssl_get_protocols(int *TLSV1, int *SSLV2, int *SSLV3);

void myssl_set_use_protocols_from_now(int TLSV1, int SSLV2, int SSLV3, int honor);
void myssl_pre_init_set_protocols(int TLSV1, int SSLV2, int SSLV3, int honor, int TLSV1_1, int tlsv1_2);

void myssl_set_wildcards(Pair *list);

void myssl_set_require_client_certificates(int truth);
int myssl_reload_cert(char *priv_file, char *cert_file, int perdomain, char *domain, char *reason);
int myssl_get_expiry_dates(char *result,int size);
int myssl_gen_domainkey(char *priv, char *pub, int reset, char *result, int *created, int size);
void myssl_disable_renegotiation( int x);
char *myssl_cipher(Myssl *m);
#endif
