diff --git a/python/fedml/core/mlops/mlops_configs.py b/python/fedml/core/mlops/mlops_configs.py index 1ed2e0476d..338f59e697 100644 --- a/python/fedml/core/mlops/mlops_configs.py +++ b/python/fedml/core/mlops/mlops_configs.py @@ -8,6 +8,7 @@ import fedml from fedml.core.mlops.mlops_utils import MLOpsUtils +from urllib.parse import urlparse class Configs(Enum): @@ -49,9 +50,15 @@ def get_request_params(): cert_path = None if str(url).startswith("https://"): cur_source_dir = os.path.dirname(__file__) - cert_path = os.path.join( - cur_source_dir, "ssl", "open-" + fedml.get_env_version() + ".fedml.ai_bundle.crt" - ) + version = fedml.get_env_version() + if version == "local": + cert_path = os.path.join( + cur_source_dir, "ssl", f"{urlparse(url).hostname}.{version}.crt" + ) + else: + cert_path = os.path.join( + cur_source_dir, "ssl", "open-" + fedml.get_env_version() + ".fedml.ai_bundle.crt" + ) return url, cert_path @@ -88,17 +95,30 @@ def get_cert_path_with_version(): cert_path = None if str(url).startswith("https://"): cur_source_dir = os.path.dirname(__file__) - cert_path = os.path.join( - cur_source_dir, "ssl", "open-" + version + ".fedml.ai_bundle.crt" - ) + if version == "local": + cert_path = os.path.join( + cur_source_dir, "ssl", f"{urlparse(url).hostname}.{version}.crt" + ) + else: + cert_path = os.path.join( + cur_source_dir, "ssl", "open-" + version + ".fedml.ai_bundle.crt" + ) + return cert_path @staticmethod def get_root_ca_path(): cur_source_dir = os.path.dirname(__file__) - cert_path = os.path.join( - cur_source_dir, "ssl", "open-root-ca.crt" - ) + version = fedml.get_env_version() + if version == "local": + url = fedml._get_backend_service() + cert_path = os.path.join( + cur_source_dir, "ssl", f"{urlparse(url).hostname}.{version}.rootca.crt" + ) + else: + cert_path = os.path.join( + cur_source_dir, "ssl", "open-root-ca.crt" + ) return cert_path @staticmethod diff --git a/python/fedml/core/mlops/ssl/open.chainopera.ai.local.crt b/python/fedml/core/mlops/ssl/open.chainopera.ai.local.crt new file mode 100644 index 0000000000..400c30aaa0 --- /dev/null +++ b/python/fedml/core/mlops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9AwpLQwHQYDVR0OBBYE +FF86fBEQfgxncWHci6O1AANn9VccMA4GA1UdDwEB/wQEAwIBhjASBgNVHRMBAf8E +CDAGAQH/AgEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAiBgNVHSAE +GzAZMA0GCysGAQQBsjEBAgIxMAgGBmeBDAECATBDBgNVHR8EPDA6MDigNqA0hjJo +dHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNy +bDA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9k +b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY +eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO +2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4 +3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP +v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s +Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/python/fedml/core/mlops/ssl/open.chainopera.ai.local.rootca.crt b/python/fedml/core/mlops/ssl/open.chainopera.ai.local.rootca.crt new file mode 100644 index 0000000000..e87d0c5783 --- /dev/null +++ b/python/fedml/core/mlops/ssl/open.chainopera.ai.local.rootca.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIFBzCCA++gAwIBAgIRALIM7VUuMaC/NDp1KHQ76aswDQYJKoZIhvcNAQELBQAw +ezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3Rlc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0GCysGAQQBsjEBAgIxMAgGBmeBDAECATBDBgNVHR8EPDA6MDigNqA0hjJo +dHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNy +bDA0BggrBgEFBQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9k +b2NhLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAHMUom5cxIje2IiFU7mOCsBr2F6CY +eU5cyfQ/Aep9kAXYUDuWsaT85721JxeXFYkf4D/cgNd9+hxT8ZeDOJrn+ysqR7NO +2K9AdqTdIY2uZPKmvgHOkvH2gQD6jc05eSPOwdY/10IPvmpgUKaGOa/tyygL8Og4 +3tYyoHipMMnS4OiYKakDJny0XVuchIP7ZMKiP07Q3FIuSS4omzR77kmc75/6Q9dP +v4wa90UCOn1j6r7WhMmX3eT3Gsdj3WMe9bYD0AFuqa6MDyjIeXq08mVGraXiw73s +Zale8OMckn/BU3O/3aFNLHLfET2H2hT6Wb3nwxjpLIfXmSVcVd8A58XH0g== +-----END CERTIFICATE----- diff --git a/python/setup.py b/python/setup.py index 4757c10a17..3847f360fa 100644 --- a/python/setup.py +++ b/python/setup.py @@ -173,6 +173,8 @@ def finalize_options(self): "fedml/core/mlops/ssl/open-test.fedml.ai_bundle.crt", "fedml/core/mlops/ssl/open-release.fedml.ai_bundle.crt", "fedml/core/mlops/ssl/open-root-ca.crt", + "fedml/core/mlops/ssl/open.chainopera.ai.local.crt", + "fedml/core/mlops/ssl/open.chainopera.ai.local.rootca.crt", ], ) ],