Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why port 587 not using self generated CA Certificate? #303

Open
bilogic opened this issue Sep 13, 2024 · 8 comments
Open

Why port 587 not using self generated CA Certificate? #303

bilogic opened this issue Sep 13, 2024 · 8 comments

Comments

@bilogic
Copy link

bilogic commented Sep 13, 2024

Before reporting a bug, please see our FAQ in FAQ.md!

Description

https://github.com/WhatsApp/proxy/blob/main/FAQ.md#5-does-the-proxy-support-https-or-socks

  1. It is indicated here that this proxy is just passing TCP traffic around.
  2. If that is the case, why need to generate a random CA Certificate?

export RANDOM_SSL=$(head -c 60 /dev/urandom | tr -dc 'a-zA-Z0-9')
export SSL_SUBJECT="${RANDOM_SSL}.net"
export SSL_DNS=${SSL_DNS}
export SSL_IP=${SSL_IP}
export DEBUG=${DEBUG:=1}
echo "--> Certificate Authority"
echo "Generating certs for ${SSL_SUBJECT}"
if [[ -e ./${CA_KEY} ]]; then
echo "====> Using existing CA Key ${CA_KEY}"
else
echo "====> Generating new CA key ${CA_KEY}"
openssl genrsa -out ${CA_KEY} 4096
fi
if [[ -e ./${CA_CERT} ]]; then
echo "====> Using existing CA Certificate ${CA_CERT}"
else
echo "====> Generating new CA Certificate ${CA_CERT}"
openssl req -x509 -new -nodes -key ${CA_KEY} -days ${CA_EXPIRE} -out ${CA_CERT} -subj "/CN=${CA_SUBJECT}" || exit 1
fi

  1. Since a random CA Certificate is generated for port 443, why doesn't port 587 use this same CA Certificate but chooses to use the official WhatsApp one?

These 3 points are total contradictions and makes media fails in places that block WhatsApp. There is so much room to do better if the aim is to really help people get access to WhatsApp.

Failed Step

The use of offical WhatsApp cert makes media fails in places that block WhatsApp.

@Nicepaul
Copy link

Yes, that’s the problem

@bilogic
Copy link
Author

bilogic commented Sep 14, 2024

@Nicepaul do you know of a workaround?

@Nicepaul
Copy link

@Nicepaul do you know of a workaround?

I'm not deploying a WhatsApp proxy on a VPS; I'm setting it up on my home OpenWRT router to bypass issues with media not working. However, the prerequisite is that the OpenWRT router must be able to successfully bypass the firewall restrictions.

@bilogic
Copy link
Author

bilogic commented Sep 14, 2024

Does the proxy behave differently on different hardware?
The proxy has to be located outside the restricted network.

@Nicepaul
Copy link

Nicepaul commented Sep 14, 2024

Does the proxy behave differently on different hardware? The proxy has to be located outside the restricted network.

This is not hardware-related. I’ve installed Passwall or SSRPlus on OpenWRT to bypass the Great Firewall of China, essentially setting up a VPN. All internal network applications and data, including WhatsApp, are routed through this tunnel, so the data packets are transmitted within the VPN and won’t be intercepted by the firewall. I’ve then mapped WhatsApp proxy's port to the public IP of the OpenWRT router. This is essentially a workaround to bypass WhatsApp’s certificate issues

@bilogic
Copy link
Author

bilogic commented Sep 14, 2024

I'm a little confused, if your mobile's WhatsApp is connected to the router which has VPN, why does it still need a proxy?

@Nicepaul
Copy link

I'm a little confused, if your mobile's WhatsApp is connected to the router which has VPN, why does it still need a proxy?

I want to use WhatsApp but prefer not to install a VPN app on my phone. Therefore, setting up a WhatsApp proxy on my home OpenWRT router seems like a good solution. Additionally, VPNs tend to drain battery and can significantly affect phone network performance, making it impractical to keep them always on. However, turning it off would disrupt WhatsApp communication.

@cloudwindy
Copy link

ping @eozturk1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants