-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #697 from CesiumGS/use-certificate
Revert to using our own SSL certificate
- Loading branch information
Showing
7 changed files
with
69 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#! /usr/bin/python3 | ||
|
||
""" | ||
Intended to be called in the | ||
This script updates the certificates used for any requests that use the core | ||
Context class. While some certs are available on the system, they may not be | ||
consistent or updated. This ensures all certs are uniform and up to date | ||
see: https://github.com/CesiumGS/cesium-omniverse/issues/306 | ||
""" | ||
|
||
import requests | ||
import sys | ||
import os | ||
|
||
|
||
def main(): | ||
# --- establish source/destination for certs --- | ||
if len(sys.argv) < 2: | ||
print("must provide a filepath for the updated certs") | ||
return -1 | ||
|
||
CERT_URL = "https://curl.se/ca/cacert.pem" | ||
CERT_FILE_PATH = sys.argv[1] | ||
|
||
# --- ensure directory structure exists ---- | ||
os.makedirs(os.path.dirname(CERT_FILE_PATH), exist_ok=True) | ||
|
||
# --- fetch and write the cert file ---- | ||
|
||
req = requests.get(CERT_URL) | ||
|
||
if req.status_code != 200: | ||
print(f"failed to fetch certificates from {CERT_URL}") | ||
return -1 | ||
|
||
# explicit encoding is required for windows | ||
with open(CERT_FILE_PATH, "w", encoding="utf-8") as f: | ||
f.write(req.text) | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters