Skip to content

Commit f40740c

Browse files
Add configurable SSL verification for RAGChatbot
1 parent 1cd38b9 commit f40740c

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

sample_solutions/RAGChatbot/api/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ INFERENCE_MODEL_NAME=meta-llama/Llama-3.1-8B-Instruct
3434
# Set this to: api.example.com (domain without https://)
3535
# If using a public domain, set any placeholder value like: not-needed
3636
LOCAL_URL_ENDPOINT=not-needed
37+
38+
# SSL Verification Settings
39+
# Set to false only for dev with self-signed certs
40+
VERIFY_SSL=true

sample_solutions/RAGChatbot/api/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
if not INFERENCE_API_TOKEN:
2929
raise ValueError("INFERENCE_API_TOKEN must be set in environment variables")
3030

31+
# SSL Verification Settings
32+
VERIFY_SSL = os.getenv("VERIFY_SSL", "true").lower() == "true"
33+
3134
# Application Settings
3235
APP_TITLE = "RAG QnA Chatbot"
3336
APP_DESCRIPTION = "A RAG-based chatbot API using LangChain and FAISS"

sample_solutions/RAGChatbot/api/services/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self):
2121
self.embedding_base_url = config.EMBEDDING_API_ENDPOINT
2222
self.inference_base_url = config.INFERENCE_API_ENDPOINT
2323
self.token = config.INFERENCE_API_TOKEN
24-
self.http_client = httpx.Client()
24+
self.http_client = httpx.Client(verify=config.VERIFY_SSL)
2525
logger.info(f"✓ API Client initialized - Embedding: {self.embedding_base_url}, Inference: {self.inference_base_url}")
2626

2727
def get_embedding_client(self):

0 commit comments

Comments
 (0)