xxxxxxxxxx
//exanple of removing last char from string
var str= "you are gay";
var strWithoutlastchar = str.substring(0, str.length - 1);
xxxxxxxxxx
Check for proxy server.
'add the following line to the subl ~/.curlrc file:'
proxy= proxyserver:proxyport
xxxxxxxxxx
This error can occur when there is a problem with the SSL/TLS handshake between two systems. It can be caused by a number of issues, including:
Mismatched SSL/TLS versions: If the client and server are using different versions of SSL/TLS, this error can occur. For example, if the client is using TLS 1.2 and the server is only configured to support TLS 1.0, this error may be triggered.
Certificate issues: If the server's SSL/TLS certificate is not properly configured or has expired, this error can occur.
Network issues: If there are problems with the network connection between the client and server, this error can occur.
To troubleshoot this issue, you can try the following steps:
Check the SSL/TLS versions being used by the client and server: Make sure that both the client and server are using the same version of SSL/TLS.
Check the server's SSL/TLS certificate: Make sure that the certificate is properly configured and has not expired. You can use a tool like OpenSSL to check the certificate's details.
Check the network connection: Make sure that the client and server are able to communicate over the network. This may involve checking firewall configurations, network routing, and other networking issues.
If these steps do not help resolve the issue, you may need to look at the server logs and client-side debugging tools to get more information about the problem.
xxxxxxxxxx
* Uses proxy env variable http_proxy == 'https://proxy.in.tum.de:8080'
^^^^^
The https:// is wrong, it should be http://.
The proxy itself should be accessed by HTTP and not HTTPS even though the target URL is HTTPS.
The proxy will nevertheless properly handle HTTPS connection and keep the end-to-end encryption.
See HTTP CONNECT method for details how this is done.
xxxxxxxxxx
Resolve: error:1408f10b:ssl routines:ssl3_get_record:wrong version number
If you have been coming across the ssl3_get_record: wrong version number error, you have come to the right place. Our Support Team has been helping a few of our customers get back on track after getting this error.
In fact, this specific error is due to the server not responding with TLS data as expected. For instance, the client starts the TLS handshake, prompting the server to reply with a non-TLS response. Since the client expects a reply from the server as part of the TLS handshake, it tries to interpret the response, ending in an error message.
Furthermore, this ends in the wrong version number with OpenSSL-based stacks since it tries to extract TLS version number, resulting in unexpected results.
Alternatively, the issue may also arise due to a middlebox or software problem in the network path to the server.
How to resolve the error
First, ensure the domain is pointing to the correct server.
Then, check the configuration file for our websites is enabled in Apache. In some cases, the default virtual host on Apache is set only for non-SSL configurations. In this scenario, symlink the website configuration file to the /etc/apache2/sites-enabled directory as seen below:
sudo ln -s /etc/apache2/sites-available/my-website.conf /etc/apache2/sites-enabled/my-website
We can verify this is successful with the command:
ls /etc/apache2/sites-enabled/
Then, restart the apache2 webserver.
Next, we have to check which internal port the NAT configuration is pointing to. Our Support Techs would like to point out that the UI allows writing ports with a comma separator, but it is not associative. For instance, even if source=80,443 it will redirect all packets to 80.
After that ensure the proxy URL is HTTP://.
Here are a few more troubleshooting tips to help fix the issue:
If we get the error while using Nginx, adding the following code to the server configuration will help:
listen 443 ssl;
}
Another option is to check if we are behind a proxy server. If yes, we have to set the proxy for curl. We can do this by adding the following line to the subl ~/.curlrc file:
proxy= proxyserver:proxyport
Additionally, if we are not behind a proxy, ensure the curlrc file does not contain proxy settings.
xxxxxxxxxx
* Uses proxy env variable http_proxy == 'https://proxy.in.tum.de:8080'
^^^^^
xxxxxxxxxx
#include <Arduino.h>
#include <WiFi.h>
#include <WebServer.h>
// functions prototype
void on_button();
const char *ssid = "admin";
const char *password = "Dialog123@";
WebServer server(80); // (2) Server 192.168.8.1
void setup() {
Serial.begin(115200);
pinMode(0, OUTPUT);
WiFi.softAP(ssid, password); // (1) Create AP
server.on("/on", on_button);
/* step(3)*/
server.begin();
}
void loop() {
/* step (4) */
server.handleClient(); // this function will check availabilty of new connection
}
void on_button()
{
const char * html_page = "<h1> Hello world </h1>";
digitalWrite(0, (1-digitalRead(0)));
server.sendHeader("Location", "/on");
server.send(302, "text/html", "");
// server.send(200, "text/html", html_page);
}
xxxxxxxxxx
$ curl www.google.com --verbose
* Rebuilt URL to: www.google.com/
* Uses proxy env variable no_proxy == 'localhost,127.0.0.1,localaddress,.localdomain.com'
* Uses proxy env variable http_proxy == 'https://proxy.in.tum.de:8080'
* Trying 131.159.0.2
* TCP_NODELAY set
* Connected to proxy.in.tum.de (131.159.0.2) port 8080 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number'
xxxxxxxxxx
$ curl -V
curl 7.61.0-DEV (x86_64-pc-linux-gnu) libcurl/7.61.0-DEV OpenSSL/1.1.1 zlib/1.2.8
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy