Michael Ansolis / TLS_cyassl

Dependencies:   cyassl-lib

Fork of TLS_cyassl by Francois Berder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TLSServer.h Source File

TLSServer.h

00001 #ifndef TLSSERVER_H
00002 #define TLSSERVER_H
00003 
00004 #include "mbed.h"
00005 #include "cyassl/ssl.h"
00006 #include "TLSConnection.h"
00007 
00008 
00009 class TLSServer : public Socket
00010 {
00011     public :
00012         
00013         TLSServer();
00014         ~TLSServer();
00015         
00016         /** Initialize the server. 
00017             It listens on port 443, init CyaSSL, load certificates and create CyaSSL context.
00018         
00019             \return True if the initializations is completed with success, false otherwise.
00020         */
00021         bool init();
00022           
00023         /** Accept incoming connection
00024         
00025             \return True if it managed to create successfully a new connection, false otherwise.
00026         */
00027         bool accept(TLSConnection &con);
00028         
00029         
00030     private :
00031     
00032         CYASSL_CTX *_ssl_ctx;
00033 };
00034 
00035 #endif