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++ Library : Other (not classified elsewhere) » Core/SSL Having issue with Lets encrypt certificate
Core/SSL Having issue with Lets encrypt certificate [message #53550] Fri, 10 April 2020 23:40 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello,

I have a fresh and valide certificate from LetsEncrypt with is private key, to test Upp compatibility, I have launch the package References : Https
...
	for(;;) {
		TcpSocket socket;
		LOG("===================================================== Waiting...");
		if(socket.Accept(server)) {
			LOG("Connection accepted");
			socket.SSLCertificate(LoadFile(GetDataFile("C:\\Users\\Xemuth\\Documents\\ssl\\cert.pem")),
			                       LoadFile(GetDataFile("C:\\Users\\Xemuth\\Documents\\ssl\\privkey.pem")),
			                       false);
			if(!socket.StartSSL()) {
				LOG("Failed to start SSL: " << socket.GetErrorDesc());
				continue;
			}
			while(socket.SSLHandshake());
			if(socket.IsError()) {
				LOG("SSL handshake failed: " << socket.GetErrorDesc());
				continue;
			}
			LOG("SSL established");
...

https://i.imgur.com/7NGXUkh.png
Any one have an idea ?


Thanks in advance.
Best regards
Re: Core/SSL Having issue with Lets encrypt certificate [message #53566 is a reply to message #53550] Mon, 13 April 2020 10:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14162
Registered: November 2005
Ultimate Member
I suspect there should be 'true' for asn1 parameter (I believe .pem files are in that format).

Mirek
Re: Core/SSL Having issue with Lets encrypt certificate [message #53578 is a reply to message #53550] Mon, 13 April 2020 15:30 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Mirek, Thanks for your help, I have try but with or without the result is the same, I have tried on my Raspberry (wich carry the server my certificate is for) and the result is slightly different :

https://i.imgur.com/RcMml2A.png

Seems like it's working but not totally !

EDIT : Result is the same with cert and pkey provided by Https Example

[Updated on: Mon, 13 April 2020 16:22]

Report message to a moderator

Re: Core/SSL Having issue with Lets encrypt certificate [message #53579 is a reply to message #53550] Mon, 13 April 2020 16:56 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
According to https://tls.mbed.org/kb/cryptography/asn1-key-structures-in- der-and-pem

Pem are Base64 encoded, maybe I should do something like that :
socket.SSLCertificate(LoadFile(Base64Decode(GetDataFile("C:\\Users\\Xemuth\\Documents\\ssl\\chain.pem"))),
		      LoadFile(Base64Decode( GetDataFile("C:\\Users\\Xemuth\\Documents\\ssl\\privkey.pem"))),
		      true);


It don't work, I will try to find other way of decoding it

EDIT : I have try to decode my certificate using this website : https://lapo.it/asn1js/ and it work :
This page contains a JavaScript generic ASN.1 parser that can decode any valid ASN.1 DER or BER structure whether Base64-encoded (raw base64, PEM armoring and begin-base64 are recognized) or Hex-encoded.

Do Upp ASN1 parser is able to reconize and decode multiple structure of pem ?

[Updated on: Mon, 13 April 2020 17:28]

Report message to a moderator

Previous Topic: lzma compression does not seem to work
Next Topic: [Proposal] Blur algorithm (fast box blur with gaussian approximation)
Goto Forum:
  


Current Time: Fri Dec 13 23:26:20 CET 2024

Total time taken to generate the page: 0.02366 seconds