c86ad7f93b
* Make it possible to extract more useful data from the certificate * Also get the OpenSSL error message when a certificate can't be validated. Send it to the verification failure callback so it can be shown to the user.
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/*
|
|
* 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>
|
|
|
|
|
|
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);
|
|
|
|
// BSocket implementation
|
|
|
|
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:
|
|
friend class BCertificate;
|
|
class Private;
|
|
Private* fPrivate;
|
|
};
|
|
|
|
|
|
#endif // _SECURE_SOCKET_H
|