I have an issue with sending a request to the website. I am using the "hentai" library to make a useful telegram bot with nhentai API on Python (don't judge please). Why do I get this error on Linux (Ubuntu)?
:~$ curl -v https://nhentai.net
* Expire in 0 ms for 6 (transfer 0x55c3a8516530)
...
* Expire in 9 ms for 1 (transfer 0x55c3a8516530)
* Trying 104.27.195.88...
* TCP_NODELAY set
* Expire in 149985 ms for 3 (transfer 0x55c3a8516530)
* Expire in 200 ms for 4 (transfer 0x55c3a8516530)
* Connected to nhentai.net (104.27.195.88) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to nhentai.net:443
CodePudding user response:
I tried with curl and python's request library on the site you mentioned and pulled the desired content. Make sure that the curl on your linux machine is working properly. If you want, you can try the simple code below.
import requests
myrequest = requests.get("https://nhentai.net/")
print(myrequest.text)
CodePudding user response:
My guess is that there is something in the middle, like a local antivirus or parental control software or some company/school middlebox/firewall which does not like the name of the website you are trying to access.
What you see is typical for DPI solutions which allow the initial TCP connect but then cause a connection close once they detect the domain name you are connecting to (which is contained in the TLS handshake ClientHello)