Skip to content

Commit c173a1f

Browse files
authored
[ZT] Clarify Python cert install (#18062)
1 parent 0390674 commit c173a1f

File tree

1 file changed

+27
-25
lines changed
  • src/content/docs/cloudflare-one/connections/connect-devices/warp/user-side-certificates

1 file changed

+27
-25
lines changed

src/content/docs/cloudflare-one/connections/connect-devices/warp/user-side-certificates/manual-deployment.mdx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -305,49 +305,51 @@ For information on installing a Cloudflare certificate for organizations, refer
305305

306306
### Python
307307

308+
Depending on which version of Python you have installed and your configuration, you may need to use either the `python` or `python3` command. If you use [virtual environments](https://docs.python.org/3/library/venv.html), you will need to repeat the following steps within each virtual environment.
309+
308310
#### Python on Windows
309311

310312
The command to install the certificate with Python on Windows automatically includes `pip` and `certifi` (the default certificate bundle for certificate validation).
311313

312314
1. [Download a Cloudflare certificate](#download-the-cloudflare-root-certificate) in `.crt` format.
313-
2. Update the bundle to include the Cloudflare certificate:
315+
2. In a PowerShell terminal, install the `certifi` package:
314316
```powershell
315-
gc "$env:USERPROFILE\Downloads\certificate.crt" | ac C:\Python37\Lib\site-packages\pip\_vendor\certifi\cacert.pem
317+
python -m pip install certifi
316318
```
317-
318-
#### Python on Mac and Linux
319-
320-
1. In a terminal, install the `certifi` package:
321-
322-
```sh
323-
pip install certifi
319+
3. Identify the Python CA store:
320+
```powershell
321+
$CERT_PATH = python -c "import certifi; print(certifi.where())"
324322
```
325-
326-
2. Identify the CA store:
327-
328-
```sh
329-
python -m certifi
323+
4. Update the bundle to include the Cloudflare certificate:
324+
```powershell
325+
gc "$env:USERPROFILE\Downloads\certificate.crt" | ac $CERT_PATH
330326
```
331-
332-
```sh output
333-
~/Library/Python/3.7/lib/python/site-packages/certifi/cert.pem
327+
5. (Optional) Configure your system variables to point to the CA store by adding them to PowerShell's configuration file:
328+
```powershell
329+
[System.Environment]::SetEnvironmentVariable('CERT_PATH', $CERT_PATH, 'Machine')
330+
[System.Environment]::SetEnvironmentVariable('SSL_CERT_FILE', $CERT_PATH, 'Machine')
331+
[System.Environment]::SetEnvironmentVariable('REQUESTS_CA_BUNDLE', $CERT_PATH, 'Machine')
334332
```
333+
6. Restart your terminal.
335334

336-
3. [Download a Cloudflare certificate](#download-the-cloudflare-root-certificate) in `.pem` format.
337-
338-
4. Append the Cloudflare certificate to this CA store by running:
335+
#### Python on Mac and Linux
339336

337+
1. [Download a Cloudflare certificate](#download-the-cloudflare-root-certificate) in `.pem` format.
338+
2. In a terminal, install the `certifi` package:
339+
```sh
340+
python -m pip install certifi
341+
```
342+
3. Append the Cloudflare certificate to this CA store by running:
340343
```sh
341344
echo | cat - certificate.pem >> $(python -m certifi)
342345
```
343-
344-
5. If needed, configure system variables to point to this CA store:
345-
346+
4. (Optional) Configure your system variables to point to the CA store by adding them to your shell's configuration file (such as `~/.zshrc` or `~/.bash_profile`). For example:
346347
```sh
347-
export CERT_PATH=$(python -m certifi)
348+
echo 'export CERT_PATH=$(python -c "import certifi; print(certifi.where())")
348349
export SSL_CERT_FILE=${CERT_PATH}
349-
export REQUESTS_CA_BUNDLE=${CERT_PATH}
350+
export REQUESTS_CA_BUNDLE=${CERT_PATH}' >> ~/.zshrc
350351
```
352+
5. Restart your terminal.
351353

352354
### Git
353355

0 commit comments

Comments
 (0)