#include <signal.h>

#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>

#define SERIAL				96875
#define EXPONENT_RSA		65535
#define KEY_SIZE			2048
#define LAST_DAY			365		/* The Certificate is long 1 year */
#define SELF_SIGNED_CERT	18
#define SUCCESS				0
#define FAIL				-1
#define NO_RSA_KEY			-2
#define NO_X509				-3
#define NO_RSA_TO_X509		-4
#define NO_VERSION			-5
#define NO_SELF_SIGN		-6

static char *ciphers = NULL;

static void sigpipe_handle __P((int x)){};
int verify_cb __P((int preverify_ok, X509_STORE_CTX *ctx));
int generate_ss_cert __P((void));
int init_client_ctx __P((void));	
int show_peer_cert __P((void));
int start_ssl __P((void));
int connect_ssl __P((void));
int accept_ssl __P((void));