server.cc revision 7db0aea6
17db0aea6SShuo Chen#include "InetAddress.h" 27db0aea6SShuo Chen#include "TlsAcceptor.h" 37db0aea6SShuo Chen#include "TlsConfig.h" 47db0aea6SShuo Chen#include "TlsStream.h" 57db0aea6SShuo Chen 67db0aea6SShuo Chenint main(int argc, char* argv[]) 77db0aea6SShuo Chen{ 87db0aea6SShuo Chen TlsConfig config; 97db0aea6SShuo Chen // config.setCaFile("ca.pem"); 107db0aea6SShuo Chen config.setCertFile("server.pem"); 117db0aea6SShuo Chen config.setKeyFile("server.pem"); 127db0aea6SShuo Chen 137db0aea6SShuo Chen InetAddress listenAddr(4433); 147db0aea6SShuo Chen TlsAcceptor acceptor(&config, listenAddr); 157db0aea6SShuo Chen 167db0aea6SShuo Chen TlsStreamPtr stream = acceptor.accept(); 177db0aea6SShuo Chen if (stream) 187db0aea6SShuo Chen { 197db0aea6SShuo Chen LOG_INFO << "OK"; 207db0aea6SShuo Chen } 217db0aea6SShuo Chen} 227db0aea6SShuo Chen 23