haiku/headers/os/net/SecureSocket.h
Mark Hellegers e1c98ceaf7 Add support for TLS SNI
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2016-06-20 19:42:24 -04:00

57 lines
1.3 KiB
C++

/*
* Copyright 2011-2016, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SECURE_SOCKET_H
#define _SECURE_SOCKET_H
#include <Socket.h>
class BCertificate;
class BSecureSocket : public BSocket {
public:
BSecureSocket();
BSecureSocket(const BNetworkAddress& peer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
BSecureSocket(const BSecureSocket& other);
virtual ~BSecureSocket();
virtual bool CertificateVerificationFailed(BCertificate&
certificate, const char* message);
status_t InitCheck();
// BSocket implementation
virtual status_t Accept(BAbstractSocket*& _socket);
virtual status_t Connect(const BNetworkAddress& peer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
virtual void Disconnect();
virtual status_t WaitForReadable(bigtime_t timeout
= B_INFINITE_TIMEOUT) const;
// BDataIO implementation
virtual ssize_t Read(void* buffer, size_t size);
virtual ssize_t Write(const void* buffer, size_t size);
protected:
status_t _SetupCommon(const char* host = NULL);
status_t _SetupConnect(const char* host = NULL);
status_t _SetupAccept();
private:
friend class BCertificate;
class Private;
Private* fPrivate;
};
#endif // _SECURE_SOCKET_H