
Can an HTTP proxy access an HTTPS website, or does the proxy address also need to start with https://? The two schemes describe different parts of the connection: one is the destination website, and the other is how your client connects to the proxy. In many common setups, an HTTP proxy can reach an HTTPS destination by creating a CONNECT tunnel; the browser or application then negotiates TLS with the website through that tunnel. This guide shows what happens in each step, how to test the route with curl and Python Requests, and what to inspect when a request fails with a 407, a tunnel error, or a certificate warning. It also explains what CONNECT does not encrypt, so you can choose an endpoint scheme with the right security properties for your network.
The short answer: an HTTP proxy can often reach an HTTPS website
Yes, provided the proxy allows the CONNECT method and the client knows how to use it. The word “HTTP” in an address such as http://YOUR_HOST:YOUR_PORT normally describes the connection from your application to the proxy. It does not, by itself, mean that the destination URL must use HTTP.
For an HTTPS destination, a compatible client first asks the proxy to open a tunnel to the destination host and port. If the proxy accepts the request, the client then performs the website’s TLS handshake through that tunnel. The proxy relays the encrypted stream; it does not need to interpret the website’s HTTPS requests for ordinary tunneling to work.
There are two separate checks: whether the proxy endpoint supports CONNECT to the target port, and whether the client is configured to use that proxy for HTTPS destination URLs. A proxy can be reachable while the tunnel is denied, and a working proxy can be bypassed if the application’s settings point to the wrong field or scheme.
HTTP proxy address vs. HTTPS website URL
Keep the proxy address and the destination URL separate when reading a configuration. In this example, the client connects to an HTTP proxy and asks it to reach an HTTPS website:
Proxy endpoint: http://YOUR_HOST:YOUR_PORT
Destination URL: https://example.com/
The http:// prefix on the proxy endpoint means the client’s connection to that proxy uses HTTP. The https:// prefix on the destination means the client expects to establish a TLS-protected session with the website. CONNECT bridges those two parts by asking the proxy to create a byte-forwarding tunnel.
An HTTPS proxy endpoint is a different option. An endpoint such as https://YOUR_HOST:YOUR_PORT means the client itself starts TLS with the proxy. The destination can still be HTTPS, so the connection may involve TLS to the proxy and a separate TLS session to the website inside the tunnel. You do not need an HTTPS proxy endpoint simply because the website URL starts with https://; choose it when the client-to-proxy hop needs TLS and your provider and client both support that endpoint type.
| Proxy endpoint | Destination URL | What the schemes describe |
|---|---|---|
http://proxy.example:PORT |
https://example.com/ |
HTTP from client to proxy; HTTPS to destination through CONNECT |
https://proxy.example:PORT |
https://example.com/ |
TLS from client to proxy; a separate HTTPS connection to the destination through the tunnel |
http://proxy.example:PORT |
http://example.com/ |
HTTP from client to proxy and an ordinary HTTP request to the destination; the destination traffic is not protected by TLS |
Endpoint labels can vary between providers and software. Confirm the exact protocol, host, port, and authentication method supplied for your account rather than changing http:// to https:// based only on the destination URL.
What CONNECT does, step by step
The HTTP CONNECT method asks a proxy to establish a tunnel to a destination identified by a host and port. For a typical HTTPS website, that destination is the site’s hostname on port 443. RFC 9110 defines the request target as host:port and says that a successful 2xx response switches the connection to tunnel mode.
A simplified HTTP/1.1 exchange looks like this:
CONNECT example.com:443 HTTP/1.1
Host: example.com:443
HTTP/1.1 200 Connection established
The exact status text and HTTP version can differ by proxy and client, but the important signal is a successful 2xx response to CONNECT. After the response headers, the client starts TLS with example.com through the newly created tunnel. The website’s certificate is then checked by the client as part of the normal TLS handshake.
The proxy may need to resolve or otherwise route to the hostname in the CONNECT request. The exact DNS path can depend on how the client forms the request and how the proxy operates. CONNECT is not a DNS privacy guarantee, and the proxy can see the requested tunnel destination, including its host and port.
What CONNECT does—and does not—encrypt
With a normal CONNECT tunnel, TLS protects the application data between your client and the HTTPS destination after the tunnel is established. The proxy forwards the TLS stream, but does not ordinarily read the page contents, cookies, or application headers inside that encrypted stream.
That does not mean every hop is encrypted. If your proxy URL begins with http://, the client-to-proxy connection itself is not protected by TLS. A network observer on that first hop may see the CONNECT destination and connection metadata. Proxy authentication headers also travel on that hop; HTTP Basic authentication encodes credentials but does not encrypt them, so an unencrypted proxy connection on an untrusted network deserves particular care. Use a supported HTTPS proxy endpoint or a trusted protected network when you need TLS between the client and proxy. Keep credentials out of source code and shared logs.
TLS inspection is another distinct setup. A proxy that terminates and re-creates TLS can inspect HTTPS contents only when the client is configured to trust the inspection certificate or a managed certificate authority. That is not ordinary CONNECT tunneling. Do not disable certificate verification to make an unexplained TLS warning disappear; investigate the certificate chain, hostname, system clock, and any organization-managed inspection policy.
Test an HTTP proxy with curl
Use a destination you are allowed to access. The following command asks curl to connect to an HTTP proxy and fetch an HTTPS URL:
curl --verbose \
--proxy "http://YOUR_HOST:YOUR_PORT" \
--proxy-user "YOUR_USERNAME:YOUR_PASSWORD" \
--connect-timeout 10 \
--max-time 30 \
"https://ipinfo.io/json"
Replace YOUR_HOST, YOUR_PORT, YOUR_USERNAME, and YOUR_PASSWORD with the connection details supplied by your proxy service. --proxy selects the proxy endpoint; --proxy-user supplies proxy authentication; --connect-timeout limits the time allowed to establish a connection; and --max-time caps the full transfer. The final URL is the HTTPS destination being tested.
In verbose output, look for a CONNECT request to ipinfo.io:443, followed by a successful tunnel response, then a TLS handshake and a response from the destination. A successful tunnel does not guarantee that every URL or port is allowed, but it confirms that this client reached this destination through the tested proxy path. The JSON body from the IP-check page should show the exit address observed by that destination.
Because verbose output and command lines can expose proxy details, avoid pasting them into public issues. Use a protected configuration file or your environment’s secret-management method for reusable credentials, and redact usernames, passwords, hostnames, and tokens before sharing logs. If a username or password contains reserved characters such as @, :, /, or #, follow your client’s URL-encoding rules or pass credentials through its dedicated authentication option.
The curl manual treats http:// as an HTTP proxy and gives an example of using that proxy with an https:// destination. For an HTTPS proxy endpoint, curl uses an https:// proxy URL; its TLS verification for the proxy is separate from verification of the destination website.
Configure Python Requests for an HTTPS destination
Requests selects a proxy by the destination scheme. The https key means “use this proxy for HTTPS URLs”; the value can still begin with http:// when the endpoint is a regular HTTP proxy that supports CONNECT. The Requests advanced usage guide documents this scheme-to-proxy mapping.
import requests
proxy = "http://YOUR_USERNAME:YOUR_PASSWORD@YOUR_HOST:YOUR_PORT"
proxies = {
"http": proxy,
"https": proxy,
}
response = requests.get(
"https://ipinfo.io/json",
proxies=proxies,
timeout=(10, 30),
)
print(response.status_code)
print(response.json())
Here, YOUR_HOST and YOUR_PORT identify the proxy, not the destination website. The http and https dictionary keys refer to destination URL schemes. The timeout tuple sets a connection timeout and a read timeout; choose values based on your application and the destination’s normal response time. A successful test should return a destination response, commonly HTTP 200 for the IP-check endpoint, plus JSON showing the exit IP observed by that endpoint.
If credentials contain reserved URL characters, encode the username and password before placing them in the proxy URL. Do not hard-code real credentials into a committed script. Requests also reads standard proxy environment variables such as http_proxy, https_proxy, and no_proxy; environment settings can affect which route is used. During testing, inspect the process environment and pass the proxies argument explicitly if you need to isolate the request from inherited proxy settings.
Diagnose common CONNECT and HTTPS errors
| Symptom | What it may indicate | What to check next |
|---|---|---|
407 Proxy Authentication Required or Tunnel connection failed: 407 |
The proxy was reached but did not accept the authentication on the proxy request | Check username, password, authentication method, and whether proxy credentials are being sent to the proxy rather than the destination. Requests’ HTTPS proxy mapping is a frequent configuration detail. |
CONNECT receives 403, 405, or another non-2xx status |
The proxy did not establish the tunnel; the endpoint may restrict CONNECT, the destination, or the requested port | Read the verbose output to see whether the status came before the TLS handshake. Confirm permitted destinations and ports with the proxy provider or network administrator. Do not keep changing endpoints to evade an explicit restriction. |
| CONNECT succeeds, then TLS certificate verification fails | The tunnel formed, but the client could not validate the destination certificate or an inspection certificate | Check the hostname, system clock, CA bundle, and managed TLS-inspection requirements. Keep certificate verification enabled. |
502 or 503 during tunnel setup |
The proxy could not establish or maintain the upstream connection, or an upstream gateway returned an error | Verify the destination hostname and port, then check provider status or network reachability. This status alone does not prove that the proxy scheme is wrong. |
| The HTTPS request returns the client’s normal public IP | The application may have bypassed the proxy or used a different proxy setting | Check Requests’ https mapping, HTTPS_PROXY, NO_PROXY/no_proxy, browser bypass lists, and whether the tested request used the intended client. |
| Connection timeout or refusal before CONNECT appears | The client may not be reaching the proxy endpoint | Verify the proxy host, port, protocol, firewall rules, and network path. |
The stage matters. If the proxy returns an error instead of a successful CONNECT response, the destination TLS handshake has not started. If CONNECT succeeds and a TLS error follows, focus on TLS validation or the destination connection rather than proxy authentication. A 407 is a proxy-authentication response; it is not the same as a website returning 401 for its own login.
When an HTTP proxy is enough—and when to choose another endpoint
An HTTP proxy is often sufficient when your tool supports HTTP proxies, the endpoint permits CONNECT to the destination port, and you only need to tunnel HTTPS traffic while keeping the client-to-proxy hop within a trusted network. It can be a straightforward option for curl, Requests, browsers, and other clients that support HTTP proxy tunneling.
Consider an HTTPS proxy endpoint when the first hop between your client and the proxy also needs TLS and your client supports that endpoint format. Choose another supported proxy protocol only when your software needs it or the provider’s documentation specifies it. Do not choose a proxy protocol solely because the destination site uses HTTPS; those are separate settings.
KimiData’s current residential proxy page lists HTTP, HTTPS, and SOCKS5 among its protocols and includes a curl example that uses an http:// proxy URL to request https://ipinfo.io/json. That example illustrates the difference between proxy endpoint scheme and destination scheme. Copy the actual gateway, port, and credentials from your account, then follow the proxy setup guide to verify the observed exit IP. For a permitted test, the residential proxy page provides the current connection options.
Use proxy access only for destinations and tasks you are authorized to access. Follow the target site’s terms, rate limits, privacy rules, and applicable law. CONNECT provides a transport tunnel; it does not grant permission to access a site or bypass its controls.
Frequently asked questions
Do I need an HTTPS proxy to open an HTTPS website?
No. A regular HTTP proxy can carry an HTTPS connection through CONNECT if the proxy and client support it. An HTTPS proxy endpoint adds TLS between your client and the proxy; it is a separate choice from the HTTPS destination.
Why does Requests need an “https” proxy entry if my proxy URL starts with “http://”?
The dictionary key tells Requests which destination URLs should use that proxy. The value describes the proxy endpoint itself. For an HTTPS destination, the key is “https”; the value may be an “http://” endpoint when that HTTP proxy supports CONNECT.
Does a successful CONNECT response mean the website returned HTTP 200?
No. A successful 2xx response to CONNECT means the tunnel was established. The website’s TLS handshake and HTTP response happen afterward and can still fail or return a different status.
Can a proxy read the HTTPS page contents after CONNECT?
Ordinary CONNECT tunneling forwards the encrypted TLS stream, so the proxy does not ordinarily read the page contents. It can see the CONNECT destination and connection metadata. TLS interception is a separate arrangement that requires the client to trust an inspection certificate.
What does “Tunnel connection failed: 407” mean?
The proxy rejected or did not receive acceptable proxy authentication while trying to establish the tunnel. Check the proxy credentials, authentication method, and client configuration. Do not confuse proxy authentication with the destination website’s login.
SOCKS5 vs. SOCKS5h in Python Requests: Where Does DNS Resolve?