summaryrefslogtreecommitdiff
path: root/yhttpd/src/sock/sslsock.h
blob: f5358cc98426991f084c9aada17852209b685fd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "../incl.h"

#ifdef OPENSSL
#ifndef SSLSOCK_H
#define SSLSOCK_H

#include "sock.h"

#include <openssl/rsa.h>
#include <openssl/crypto.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

using namespace std;

class sslsock : public sock
{
private:
  SSL_CTX* p_ctx;
  string s_certificate_path;
  string s_privatekey_path;
  map<int,void*> map_certs;

public:

  sslsock( );
  ~sslsock( );

  int _send(socketcontainer *p_sock, const char *sz, int len);
  int _read(socketcontainer *p_sock, char *sz, int len);
  int _close(socketcontainer *p_sock);
  void _main_loop_init();
  bool _main_loop_do_ssl_stuff(int &i_new_sock);
  socketcontainer* _create_container(int& i_sock);
  int _make_server_socket(int i_port);
};

#endif
#endif