fix ssl error
This commit is contained in:
parent
38f218691d
commit
0e5ade1cf5
@ -36,7 +36,7 @@ class VectorDatabaseService:
|
|||||||
api_key: API key for authentication (optional)
|
api_key: API key for authentication (optional)
|
||||||
collection_name: Name of the collection to use
|
collection_name: Name of the collection to use
|
||||||
prefer_grpc: Whether to use gRPC instead of HTTP
|
prefer_grpc: Whether to use gRPC instead of HTTP
|
||||||
https: Whether to use HTTPS. If None, auto-detect based on host
|
https: Whether to use HTTPS. If None, skip SSL
|
||||||
"""
|
"""
|
||||||
self.host = host or settings.QDRANT_HOST
|
self.host = host or settings.QDRANT_HOST
|
||||||
self.port = port or settings.QDRANT_PORT
|
self.port = port or settings.QDRANT_PORT
|
||||||
@ -49,16 +49,7 @@ class VectorDatabaseService:
|
|||||||
|
|
||||||
# Handle HTTPS setting properly
|
# Handle HTTPS setting properly
|
||||||
if https is None:
|
if https is None:
|
||||||
# First check if explicitly set in environment
|
#TODO ensure SSL
|
||||||
qdrant_https_env = os.getenv("QDRANT_HTTPS")
|
|
||||||
if qdrant_https_env is not None:
|
|
||||||
# Use the parsed boolean value from settings
|
|
||||||
https = settings.QDRANT_HTTPS
|
|
||||||
else:
|
|
||||||
# Auto-detect: Use HTTP for localhost and known development IPs, HTTPS for others
|
|
||||||
https = not (self.host in ["localhost", "127.0.0.1"] or self.host.startswith("192.168.") or self.host.startswith("10."))
|
|
||||||
# Override for specific known HTTP-only servers
|
|
||||||
if self.host == "34.171.134.17":
|
|
||||||
https = False
|
https = False
|
||||||
|
|
||||||
logger.info(f"Connecting to Qdrant at {self.host}:{self.port} (HTTPS: {https}, gRPC: {prefer_grpc})")
|
logger.info(f"Connecting to Qdrant at {self.host}:{self.port} (HTTPS: {https}, gRPC: {prefer_grpc})")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user