What version is the ssl server used?

Created at 04 Jul 2019, 17:49
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
66

66281850

Joined 26.06.2019

What version is the ssl server used?
04 Jul 2019, 17:49


Hi,

In the example of c#,The following code is used to establish a network connection.

 

  _tcpClient = new TcpClient(_apiHost, _apiPort); ;
            _apiSocket = new SslStream(_tcpClient.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
            _apiSocket.AuthenticateAsClient(_apiHost);

 

 

But I am a C++ developer, I want to connect to the server in C++ code.

I want to know:

1: What version of the ssl protocol is used by the server?

 TLS_client_method  ?

TLS_server_method?

TLSv1_1_client_method?

or  other?

 

2: Verify if a certificate file is needed?

 


@66281850
Replies

canbitwell
04 Jul 2019, 21:39

I am using TLS_client_method which works fine for me.

 

For certificate verification, I use: SSL_CTX_load_verify_locations(m_sslCtx, "ca-certs.pem", NULL);

You can get the ca-certs from Mozilla CA bundle. Or you can just copy one from a stunnel release.

 

I also have a custom OnSSLVerify which I think is optional (just some caching mechanism and unknown cert msgbox)

SSL_CTX_set_verify(m_sslCtx, SSL_VERIFY_PEER, &OnSSLVerify);


@canbitwell

66281850
05 Jul 2019, 04:51

RE:

canbitwell said:

I am using TLS_client_method which works fine for me.

 

For certificate verification, I use: SSL_CTX_load_verify_locations(m_sslCtx, "ca-certs.pem", NULL);

You can get the ca-certs from Mozilla CA bundle. Or you can just copy one from a stunnel release.

 

I also have a custom OnSSLVerify which I think is optional (just some caching mechanism and unknown cert msgbox)

SSL_CTX_set_verify(m_sslCtx, SSL_VERIFY_PEER, &OnSSLVerify);

Thank you very much.


@66281850