From c9e50f62b3a59133b64d98d15bfe18c52b2ba7f5 Mon Sep 17 00:00:00 2001
From: suchinton2001 <suchinton.2001@gmail.com>
Date: Thu, 14 Sep 2023 18:23:03 +0530
Subject: [PATCH] Update default config

- Add License header
- Add CA.pem file path to enable "Secure mode" connection with kuksa

Bug-AGL: SPEC-4905

Signed-off-by: suchinton2001 <suchinton.2001@gmail.com>
Change-Id: Ib9c8d7d2984db97563d6ba62d03d272b79979823
---
 extras/config.py | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/extras/config.py b/extras/config.py
index 5056cc3..cc61c57 100644
--- a/extras/config.py
+++ b/extras/config.py
@@ -1,14 +1,34 @@
+"""
+   Copyright 2023 Suchinton Chakravarty
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+"""
+
 import os
 import platform
 
-python_version = "python" + platform.python_version_tuple()[0] + "." + platform.python_version_tuple()[1]
+python_version = f"python{'.'.join(platform.python_version_tuple()[:2])}"
+
+CA = os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/CA.pem"))
 
 KUKSA_CONFIG = {
     "ip": 'localhost',
     "port": "8090",
     'protocol': 'ws',
     'insecure': False,
+    'cacertificate': CA,
+    'tls_server_name': "Server",
 }
 
 TOKEN_PATH = os.path.join(os.path.expanduser("~"), 
-                          f".local/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token")
\ No newline at end of file
+                          f".local/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token")
-- 
2.16.6