2011-11-22 01:07:52 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2011, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _SECURE_SOCKET_H
|
|
|
|
#define _SECURE_SOCKET_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <Socket.h>
|
|
|
|
|
|
|
|
|
2014-01-15 20:39:06 +04:00
|
|
|
class BCertificate;
|
|
|
|
|
|
|
|
|
2011-11-22 01:07:52 +04:00
|
|
|
class BSecureSocket : public BSocket {
|
|
|
|
public:
|
|
|
|
BSecureSocket();
|
|
|
|
BSecureSocket(const BNetworkAddress& peer,
|
|
|
|
bigtime_t timeout = B_INFINITE_TIMEOUT);
|
|
|
|
BSecureSocket(const BSecureSocket& other);
|
|
|
|
virtual ~BSecureSocket();
|
|
|
|
|
2014-02-22 17:49:57 +04:00
|
|
|
virtual bool CertificateVerificationFailed(BCertificate&
|
2014-11-04 17:34:19 +03:00
|
|
|
certificate, const char* message);
|
2014-01-15 20:39:06 +04:00
|
|
|
|
|
|
|
// BSocket implementation
|
|
|
|
|
2011-11-22 01:07:52 +04:00
|
|
|
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);
|
|
|
|
|
|
|
|
private:
|
2014-01-15 20:39:06 +04:00
|
|
|
friend class BCertificate;
|
2011-11-22 01:07:52 +04:00
|
|
|
class Private;
|
|
|
|
Private* fPrivate;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _SECURE_SOCKET_H
|