[Fix] Add args for mTLS support (#3430)
Co-authored-by: declark1 <daniel.clark@ibm.com>
This commit is contained in:
parent
a7c871680e
commit
03d37f2441
@ -8,6 +8,7 @@ change `vllm/entrypoints/openai/api_server.py` instead.
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
import ssl
|
||||||
from typing import AsyncGenerator
|
from typing import AsyncGenerator
|
||||||
|
|
||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
@ -86,10 +87,12 @@ if __name__ == "__main__":
|
|||||||
type=str,
|
type=str,
|
||||||
default=None,
|
default=None,
|
||||||
help="The CA certificates file")
|
help="The CA certificates file")
|
||||||
parser.add_argument("--ssl-cert-reqs",
|
parser.add_argument(
|
||||||
type=int,
|
"--ssl-cert-reqs",
|
||||||
default=0,
|
type=int,
|
||||||
help="Whether client certificate is required")
|
default=int(ssl.CERT_NONE),
|
||||||
|
help="Whether client certificate is required (see stdlib ssl module's)"
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--root-path",
|
"--root-path",
|
||||||
type=str,
|
type=str,
|
||||||
|
|||||||
@ -5,6 +5,7 @@ from contextlib import asynccontextmanager
|
|||||||
import os
|
import os
|
||||||
import importlib
|
import importlib
|
||||||
import inspect
|
import inspect
|
||||||
|
import ssl
|
||||||
|
|
||||||
from prometheus_client import make_asgi_app
|
from prometheus_client import make_asgi_app
|
||||||
import fastapi
|
import fastapi
|
||||||
@ -124,6 +125,16 @@ def parse_args():
|
|||||||
type=str,
|
type=str,
|
||||||
default=None,
|
default=None,
|
||||||
help="The file path to the SSL cert file")
|
help="The file path to the SSL cert file")
|
||||||
|
parser.add_argument("--ssl-ca-certs",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help="The CA certificates file")
|
||||||
|
parser.add_argument(
|
||||||
|
"--ssl-cert-reqs",
|
||||||
|
type=int,
|
||||||
|
default=int(ssl.CERT_NONE),
|
||||||
|
help="Whether client certificate is required (see stdlib ssl module's)"
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--root-path",
|
"--root-path",
|
||||||
type=str,
|
type=str,
|
||||||
@ -262,4 +273,6 @@ if __name__ == "__main__":
|
|||||||
log_level=args.uvicorn_log_level,
|
log_level=args.uvicorn_log_level,
|
||||||
timeout_keep_alive=TIMEOUT_KEEP_ALIVE,
|
timeout_keep_alive=TIMEOUT_KEEP_ALIVE,
|
||||||
ssl_keyfile=args.ssl_keyfile,
|
ssl_keyfile=args.ssl_keyfile,
|
||||||
ssl_certfile=args.ssl_certfile)
|
ssl_certfile=args.ssl_certfile,
|
||||||
|
ssl_ca_certs=args.ssl_ca_certs,
|
||||||
|
ssl_cert_reqs=args.ssl_cert_reqs)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user