R2 SSL Error
Started by Sergey_Vl on 21-Jan-2022/5:10:19-8:00
Sergey_Vl — 21-Jan-2022/5:10:19-8:00
Hi!
>> about
REBOL/View 2.7.8.3.1 1-Jan-2011
Copyright 2000-2011 REBOL Technologies. All rights reserved.
REBOL is a trademark of REBOL Technologies. WWW.REBOL.COM
>> read https://rebolforum.com
connecting to: rebolforum.com
** Command Error: SSL Error: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
** Where: build-port
** Near: system/words/set-modes port/sub-port [secure: true]
how it fix?
Sunanda — 21-Jan-2022/11:47:47-8:00
Sadly, Rebol 2 cannot read HTTPS.
It can do plain old HTTP:
read http://rebolforum.com
== {<html><head><title></title><META HTTP-EQUIV="REFRESH" CONTENT="0; URL=./index.cgi"></head>
Sergey_Vl — 21-Jan-2022/19:41:05-8:00
>> ? system/schemes/https
SYSTEM/SCHEMES/HTTPS is an object of value:
scheme word! HTTPS
host none! none
port-id integer! 443
...
passive none! none
cache-size integer! 5
user-agent string! "REBOL View 2.7.8.3.1"
>> read https://ya.ru
connecting to: ya.ru
== {<!DOCTYPE html><html class="i-ua_js_no i-ua_css_standart i-ua_browser_unknown i-ua_browser-engine_unknown i-ua_browser_deskto...
Perhaps some encryption algorithm is missing. Perhaps someone has already implemented it?
Kaj — 22-Jan-2022/14:30:44-8:00
You're right, R2 used to do HTTPS, but the encryption ciphers are outdated for most connections. Because they are built in, and R2 is closed source, there is no obvious way to update them.
Kaj — 22-Jan-2022/14:30:45-8:00
You're right, R2 used to do HTTPS, but the encryption ciphers are outdated for most connections. Because they are built in, and R2 is closed source, there is no obvious way to update them.
Kaj — 22-Jan-2022/14:30:47-8:00
You're right, R2 used to do HTTPS, but the encryption ciphers are outdated for most connections. Because they are built in, and R2 is closed source, there is no obvious way to update them.
Sergey_Vl — 22-Jan-2022/20:03:04-8:00
Manipulation with object "system/schemes/HTTPS" can be help? Or make function like "read-https" which open TCP port (...open/binary/no-wait tcp://:443...) and create required encrypt code is not exit? But this is just an amateurish questions of a beginner :)
The potential of R2 seems so great that the lack of source code can be compensated by thoughtful architecture and opportunities :)
Opensource R3 and Red are less complete (alpha) and much more demanding on OS and hardware.
Kaj — 23-Jan-2022/13:39:49-8:00
Yes, you could write your own HTTPS implementation, but that is very advanced work.
You could also write a binding to some existing HTTPS library, but that is fairly advanced work and may be hard to do in R2. And it would introduce a dependency, possibly OS-dependent.
Sergey_Vl — 24-Jan-2022/4:03:18-8:00
"...some existing HTTPS library..." are using:
...for HTTPS "curl"
>> tmp: copy "" call/output "curl -s https://rebolforum.com" tmp tmp: to-block tmp
== [<html> <head> <title> </title> <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=./index.cgi"> </head> <body
bgcolor="#FFFFFF"> </body...
...for E-mail whit proxy (https://www.stunnel.org).
But a solution without using external programs would be much better.
Kaj — 24-Jan-2022/8:27:54-8:00
Yes, that's the easiest way. If you don't need high performance, it works. I'm currently using cURL that way in the Meta compiler client.
I once wrote a binding for R3 to LibCURL. That's the next step up to make it less primitive. Potentially, LibCURL can be linked in statically in R3, but not R2.
Sergey_Vl — 24-Jan-2022/17:00:40-8:00
LibCURL/OpenSSL can be "linked in dynamic" for R2? Some like "curllib: load/library decompress #{789CE53C6B77E..."
Kaj — 25-Jan-2022/18:46:06-8:00
You need to load it by file name, and then bind the functions in the library,
Sergey_Vl — 5-Feb-2022/20:26:35-8:00
>> ? system/components/ssl
SYSTEM/COMPONENTS/SSL is an object of value:
Title string! "Secure Socket Layer"
Date date! 17-Jan-2002/22:45:19
Name word! ssl
Version tuple! 1.4.0
File file! %comp-ssl.r
...
it turns out SSL is written on Rebol? If "yes" is it possible to "update" it? Does anyone have a "comp-ssl.r" file?
Kaj — 6-Feb-2022/16:47:56-8:00
I think that's just metadata so R2 knows which features it has. I would expect comp-ssl.r to be high-level code that calls low-level C code.
It's probably possible to write a new HTTPS scheme, it may even be possible to replace the existing handler, if you don't need speed it may be possible to write it in REBOL, but as I said, that's advanced work. Many people have wanted it for a long time, but nobody has done it.
Reply