compiled fixes on mac and windows
This commit is contained in:
		@@ -1,6 +1,10 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
All notable changes to this project will be documented in this file.
 | 
					All notable changes to this project will be documented in this file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [6.2.4] - 2019-09-22
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Add options to configure TLS ; contributed by Matt DeBoer. Only implemented for OpenSSL TLS backend for now.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [6.2.3] - 2019-09-21
 | 
					## [6.2.3] - 2019-09-21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Fix crash in the Linux unittest in the HTTP client code, in Socket::readBytes
 | 
					- Fix crash in the Linux unittest in the HTTP client code, in Socket::readBytes
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -141,8 +141,9 @@ std::string getSSLErrorDescription(OSStatus status)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace ix
 | 
					namespace ix
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    SocketAppleSSL::SocketAppleSSL(int fd) : Socket(fd),
 | 
					    SocketAppleSSL::SocketAppleSSL(const SocketTLSOptions& tlsOptions, int fd) : Socket(fd),
 | 
				
			||||||
        _sslContext(nullptr)
 | 
					        _sslContext(nullptr),
 | 
				
			||||||
 | 
					        _tlsOptions(tlsOptions)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ;
 | 
					        ;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "IXCancellationRequest.h"
 | 
					#include "IXCancellationRequest.h"
 | 
				
			||||||
#include "IXSocket.h"
 | 
					#include "IXSocket.h"
 | 
				
			||||||
 | 
					#include "IXSocketTLSOptions.h"
 | 
				
			||||||
#include <Security/SecureTransport.h>
 | 
					#include <Security/SecureTransport.h>
 | 
				
			||||||
#include <Security/Security.h>
 | 
					#include <Security/Security.h>
 | 
				
			||||||
#include <mutex>
 | 
					#include <mutex>
 | 
				
			||||||
@@ -17,7 +18,7 @@ namespace ix
 | 
				
			|||||||
    class SocketAppleSSL final : public Socket
 | 
					    class SocketAppleSSL final : public Socket
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        SocketAppleSSL(int fd = -1);
 | 
					        SocketAppleSSL(const SocketTLSOptions& tlsOptions, int fd = -1);
 | 
				
			||||||
        ~SocketAppleSSL();
 | 
					        ~SocketAppleSSL();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        virtual bool connect(const std::string& host,
 | 
					        virtual bool connect(const std::string& host,
 | 
				
			||||||
@@ -33,6 +34,8 @@ namespace ix
 | 
				
			|||||||
    private:
 | 
					    private:
 | 
				
			||||||
        SSLContextRef _sslContext;
 | 
					        SSLContextRef _sslContext;
 | 
				
			||||||
        mutable std::mutex _mutex; // AppleSSL routines are not thread-safe
 | 
					        mutable std::mutex _mutex; // AppleSSL routines are not thread-safe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        SocketTLSOptions _tlsOptions;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace ix
 | 
					} // namespace ix
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace ix
 | 
					namespace ix
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    SocketMbedTLS(const SocketTLSOptions& tlsOptions) :
 | 
				
			||||||
 | 
					        _tlsOptions(tlsOptions)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        ;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    SocketMbedTLS::~SocketMbedTLS()
 | 
					    SocketMbedTLS::~SocketMbedTLS()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        close();
 | 
					        close();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@
 | 
				
			|||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "IXSocket.h"
 | 
					#include "IXSocket.h"
 | 
				
			||||||
 | 
					#include "IXSocketTLSOptions.h"
 | 
				
			||||||
#include <mbedtls/ctr_drbg.h>
 | 
					#include <mbedtls/ctr_drbg.h>
 | 
				
			||||||
#include <mbedtls/debug.h>
 | 
					#include <mbedtls/debug.h>
 | 
				
			||||||
#include <mbedtls/entropy.h>
 | 
					#include <mbedtls/entropy.h>
 | 
				
			||||||
@@ -20,7 +21,7 @@ namespace ix
 | 
				
			|||||||
    class SocketMbedTLS final : public Socket
 | 
					    class SocketMbedTLS final : public Socket
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        SocketMbedTLS() = default;
 | 
					        SocketMbedTLS(const SocketTLSOptions& tlsOptions);
 | 
				
			||||||
        ~SocketMbedTLS();
 | 
					        ~SocketMbedTLS();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        virtual bool connect(const std::string& host,
 | 
					        virtual bool connect(const std::string& host,
 | 
				
			||||||
@@ -40,6 +41,7 @@ namespace ix
 | 
				
			|||||||
        mbedtls_ctr_drbg_context _ctr_drbg;
 | 
					        mbedtls_ctr_drbg_context _ctr_drbg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        std::mutex _mutex;
 | 
					        std::mutex _mutex;
 | 
				
			||||||
 | 
					        SocketTLSOptions _tlsOptions;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        bool init(const std::string& host, std::string& errMsg);
 | 
					        bool init(const std::string& host, std::string& errMsg);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,6 +22,7 @@ namespace ix
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd)
 | 
					    SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd)
 | 
				
			||||||
        : Socket(fd)
 | 
					        : Socket(fd)
 | 
				
			||||||
 | 
					        , _tlsOptions(tlsOptions),
 | 
				
			||||||
        , _ssl_connection(nullptr)
 | 
					        , _ssl_connection(nullptr)
 | 
				
			||||||
        , _ssl_context(nullptr)
 | 
					        , _ssl_context(nullptr)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user