Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » [SOLVED] Purpose of HttpRequest::SSLCertificate
[SOLVED] Purpose of HttpRequest::SSLCertificate [message #51438] Mon, 25 March 2019 16:55 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Upp,

I'm trying to use custom certificats with HttpRequest so I did somethink like this :
requete3.SSLCertificate("TEST","TEST",false );


I was expecting to retrieve this keyWord "TEST" into <Core/SSL> socket.cpp Start() Function by using debug mode but the fact is I never find "TEST" Keyword.
Is it a bug or I just didnt understand the use case of SSLCertificate ?

Another Question, this method is used to set the certificate used to handshake with the server ?

Can someone explain me how Core/SSL select the right certificate to handshake the server ?


PS : Theide version is 12883, Compiled 03/24/2019 01:32:00 (the latest version atm)

Thanks in advance.

Best regard

[Updated on: Tue, 26 March 2019 16:18]

Report message to a moderator

Re: Purpose of HttpRequest::SSLCertificate [message #51443 is a reply to message #51438] Tue, 26 March 2019 08:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Check

bool SslContext::UseCertificate(String certdata, String pkeydata, bool cert_asn1)

and corresponding SSL functions - that is where those values are consumed.

Re: Purpose of HttpRequest::SSLCertificate [message #51446 is a reply to message #51438] Tue, 26 March 2019 12:09 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hi Mirek,

Thanks for your reply.

By looking deeply the code of CORE/SSL. In
 bool TcpSocket::SSLImp::Start() 

this Happen :
if(socket.cert.GetCount())
    context.UseCertificate(socket.cert, socket.pkey, socket.asn1);

I guess, the purpose of this is to change the certificate when socket.cert.GetCount() > 0
but the probleme is, with this kind of code :
	HttpRequest requete3(requete2.GetRedirectUrl());
	requete3.GET();
	requete3.StdHeaders(true);
	requete3.SSLCertificate("TEST","TEST",false );
	Cout() <<  requete3.Execute();

this :
  if(socket.cert.GetCount())  
is never equal to true.

may be that attaching the socket to the SSLImp structure does not work well, Or I'm just stupid and didnt understood how to use it Very Happy

What you think about it ?

Thanks in advance.

Best regard
Re: Purpose of HttpRequest::SSLCertificate [message #51447 is a reply to message #51438] Tue, 26 March 2019 12:30 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
the socket cert and pkey data is reseted when HttpRequest::Execute() is called due to :

call of void HttpRequest::StartConnect() in DNS phase

by modifing the method a bit it work. Is there any way to do Execute method specify a Phase ?
If you want I could do a fix then post it here.

[Updated on: Tue, 26 March 2019 13:31]

Report message to a moderator

Re: Purpose of HttpRequest::SSLCertificate [message #51452 is a reply to message #51438] Tue, 26 March 2019 16:18 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Well,
Since I'm stupid I thought SSlCertificate was made to set
the certificate to send in case of TSL SSL certificate request Authentification.
But it's just used to make the server side of Https server.

Well sorry guys...

[Updated on: Tue, 26 March 2019 16:24]

Report message to a moderator

Previous Topic: The right container
Next Topic: Zlib problem
Goto Forum:
  


Current Time: Thu Mar 28 11:29:12 CET 2024

Total time taken to generate the page: 0.01445 seconds