This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Forgotten_Boy's profile picture

Using HTTPS to POST

Started by Forgotten_Boy, 09 June 2015 - 06:00 AM
Forgotten_Boy #1
Posted 09 June 2015 - 08:00 AM
I'm using ComputerCraft 1.73 and making a secure http POST to my local web server like this:
http.post("https://localhost"…

and my server (which, for the record, works fine serving HTTP and HTTPS requests to browsers without any trouble) shows this error when the CC POST arrives:
code 336151574: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown,
code 336150757: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure


Admittedly this is almost certainly a server-side error but I thought I'd ask in case someone here had seen it. I've read here that CC is used with HTTPS without problems to other servers so I'm hoping someone might have some info. I assumed that CC would be using credentials provided by Java which would then be using my browser credentials and therefore the CC HTTPS request wouldn't look any different than a browser request; evidently that is not the case.

Anyway, if it's not too off-topic for the pros then even your random guesses would be appreciated!
doublequestionmark #2
Posted 18 June 2015 - 03:57 AM
–snip–
code 336151574: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown,
code 336150757: error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure
–snip–

i've seen this before, you need an ssl cert signed by a trusted CA.

if your running apache on a ubuntu server, here's a great tutorial on how to obtain one for free and configure it with apache
Edited on 18 June 2015 - 01:59 AM
Anavrins #3
Posted 18 June 2015 - 06:58 AM
That or you can make your OS trust your self-signed CA certificate.
Forgotten_Boy #4
Posted 19 June 2015 - 06:11 AM
Thanks for replying! I'm going to try it shortly with a real certificate, I was just hoping someone would be able to comment on the Java part - presumably CC is sending Java credentials and this is somehow different than what the browser would do - as my current server serves HTTPS to browsers no problem (at localhost), just not to CC. But I'll see what happens when I use a proper cert hosted at the domain name, which I assume is the use case everyone here has when they say that HTTPS and CC is no problem for them.
Anavrins #5
Posted 19 June 2015 - 11:55 PM
Yeah, but that's because you have a self-signed certificate, on browsers you can chose to ignore the security warning, but in this case, it's a bit difficult to do in CC.
There are tutorials on google on how to make your OS trust your self-signed CA cert.