A fork of the TLS_cyassl embedded SSL library with certificate validation disabled.
Fork of TLS_cyassl by
TLSServer.h@6:c12f49c210c2, 2013-09-18 (annotated)
- Committer:
- feb11
- Date:
- Wed Sep 18 15:18:51 2013 +0000
- Revision:
- 6:c12f49c210c2
- Parent:
- 4:86a5029194b4
added some comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
feb11 | 4:86a5029194b4 | 1 | #ifndef TLSSERVER_H |
feb11 | 4:86a5029194b4 | 2 | #define TLSSERVER_H |
feb11 | 4:86a5029194b4 | 3 | |
feb11 | 4:86a5029194b4 | 4 | #include "mbed.h" |
feb11 | 4:86a5029194b4 | 5 | #include "cyassl/ssl.h" |
feb11 | 4:86a5029194b4 | 6 | #include "TLSConnection.h" |
feb11 | 4:86a5029194b4 | 7 | |
feb11 | 6:c12f49c210c2 | 8 | |
feb11 | 4:86a5029194b4 | 9 | class TLSServer : public Socket |
feb11 | 4:86a5029194b4 | 10 | { |
feb11 | 4:86a5029194b4 | 11 | public : |
feb11 | 4:86a5029194b4 | 12 | |
feb11 | 4:86a5029194b4 | 13 | TLSServer(); |
feb11 | 4:86a5029194b4 | 14 | ~TLSServer(); |
feb11 | 4:86a5029194b4 | 15 | |
feb11 | 6:c12f49c210c2 | 16 | /** Initialize the server. |
feb11 | 6:c12f49c210c2 | 17 | It listens on port 443, init CyaSSL, load certificates and create CyaSSL context. |
feb11 | 6:c12f49c210c2 | 18 | |
feb11 | 6:c12f49c210c2 | 19 | \return True if the initializations is completed with success, false otherwise. |
feb11 | 6:c12f49c210c2 | 20 | */ |
feb11 | 4:86a5029194b4 | 21 | bool init(); |
feb11 | 4:86a5029194b4 | 22 | |
feb11 | 6:c12f49c210c2 | 23 | /** Accept incoming connection |
feb11 | 6:c12f49c210c2 | 24 | |
feb11 | 6:c12f49c210c2 | 25 | \return True if it managed to create successfully a new connection, false otherwise. |
feb11 | 6:c12f49c210c2 | 26 | */ |
feb11 | 4:86a5029194b4 | 27 | bool accept(TLSConnection &con); |
feb11 | 4:86a5029194b4 | 28 | |
feb11 | 4:86a5029194b4 | 29 | |
feb11 | 4:86a5029194b4 | 30 | private : |
feb11 | 4:86a5029194b4 | 31 | |
feb11 | 4:86a5029194b4 | 32 | CYASSL_CTX *_ssl_ctx; |
feb11 | 4:86a5029194b4 | 33 | }; |
feb11 | 4:86a5029194b4 | 34 | |
feb11 | 4:86a5029194b4 | 35 | #endif |