In my amd64 debian machine:
$ wget https://github.com/moparisthebest/static-curl/releases/download/v7.88.1/curl-amd64
$ ./curl-amd64 https://1.1.1.1 | head -n 20
//It can show the correct 1.1.1.1 logo
$ scp curl-amd64 [email protected]:/root/
//scp it into my arm64 armbian machine 192.168.0.2
In my arm64 armbian machine: (I see there's an aarch64 version of static-curl, here I'm just finding a simplest way to test fex-emu environment)
$ curl --silent https://raw.githubusercontent.com/FEX-Emu/FEX/main/Scripts/InstallFEX.py --output /tmp/InstallFEX.py && python3 /tmp/InstallFEX.py && rm /tmp/InstallFEX.py
//successfully installed fex-emu
$ FEXInterpreter ./curl-amd64 -V
curl 7.88.1 (x86_64-pc-linux-musl) libcurl/7.88.1 OpenSSL/1.1.1t zlib/1.2.12 libssh2/1.10.0 nghttp2/1.47.0
Release-Date: 2023-02-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets
$ FEXInterpreter ./curl-amd64 -v https://1.1.1.1
* Trying 1.1.1.1:443...
* Connected to 1.1.1.1 (1.1.1.1) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: none
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Cloudflare, Inc.; CN=cloudflare-dns.com
* start date: Jan 12 00:00:00 2023 GMT
* expire date: Jan 11 23:59:59 2024 GMT
* subjectAltName: host "1.1.1.1" matched cert's IP address!
* issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1
* SSL certificate verify ok.
* Send failure: Broken pipe
* OpenSSL SSL_write: Broken pipe, errno 32
* Closing connection 0
curl: (16) Send failure: Broken pipe
Maybe there's a bug in fex-emu about network socket, any hint?
[email protected]:~$ FEXInterpreter /usr/bin/curl -V
curl 7.85.0 (x86_64-pc-linux-gnu) libcurl/7.85.0 OpenSSL/3.0.5 zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.3 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.49.0 librtmp/2.3
Release-Date: 2022-08-31
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
[email protected]:~$ FEXInterpreter /usr/bin/curl 1.1.1.1
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
Seems to work fine here. Maybe something is wrong with musl since I don't test musl things frequently.
Retested with your provided binary and it also seems to work.
[email protected]:~$ FEXInterpreter ./curl-amd64 -V
curl 7.88.1 (x86_64-pc-linux-musl) libcurl/7.88.1 OpenSSL/1.1.1t zlib/1.2.12 libssh2/1.10.0 nghttp2/1.47.0
Release-Date: 2023-02-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets
[email protected]:~$ FEXInterpreter ./curl-amd64 1.1.1.1
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
It seems the problem is about https/tls:
[email protected]:~$ FEXInterpreter ./curl-amd64 1.1.1.1
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
[email protected]:~$ FEXInterpreter ./curl-amd64 https://1.1.1.1
curl: (16) Send failure: Broken pipe
[email protected]:~$ FEXInterpreter ./curl-amd64 https://1.1.1.1
<!DOCTYPE html><html theme="light" lang="en-US" prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><title>1.1.1.1 — The free app that makes your Internet faster.</title><!-- Early iOS detection--><script>if (/iPad|iPhone|iPod/.test(navigator.userAgent)) {
document.documentElement.setAttribute('is-ios', '')
<snipped>
Curious, https also works fine here.
You are right, I think it's the CCP's GFW that cause the network problem, and the FEX-Emu won't use my ip route proxy rules.
So I close this issue.