|
15 | 15 |
|
16 | 16 | import code
|
17 | 17 | import os
|
| 18 | +import pathlib |
18 | 19 | import re
|
19 | 20 | import sys
|
20 | 21 | import types
|
@@ -232,8 +233,18 @@ def main(self, *args, **kwargs):
|
232 | 233 | @click.option(
|
233 | 234 | "--loop", type=click.Choice(["auto", "asyncio", "uvloop"]), default="auto", help="Event loop implementation."
|
234 | 235 | )
|
235 |
| -@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file") |
236 |
| -@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file") |
| 236 | +@click.option( |
| 237 | + "--ssl-certfile", |
| 238 | + type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path), |
| 239 | + default=None, |
| 240 | + help="SSL certificate file", |
| 241 | +) |
| 242 | +@click.option( |
| 243 | + "--ssl-keyfile", |
| 244 | + type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path), |
| 245 | + default=None, |
| 246 | + help="SSL key file", |
| 247 | +) |
237 | 248 | @click.option("--reloader/--no-reloader", is_flag=True, default=True, help="Runs with reloader.")
|
238 | 249 | @pass_script_info
|
239 | 250 | def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile, reloader):
|
@@ -296,8 +307,18 @@ def develop_command(info, host, port, interface, loop, ssl_certfile, ssl_keyfile
|
296 | 307 | @click.option("--access-log/--no-access-log", is_flag=True, default=False, help="Enable access log.")
|
297 | 308 | @click.option("--backlog", type=int, default=2048, help="Maximum number of connections to hold in backlog")
|
298 | 309 | @click.option("--backpressure", type=int, help="Maximum number of requests to process concurrently (per worker)")
|
299 |
| -@click.option("--ssl-certfile", type=str, default=None, help="SSL certificate file") |
300 |
| -@click.option("--ssl-keyfile", type=str, default=None, help="SSL key file") |
| 310 | +@click.option( |
| 311 | + "--ssl-certfile", |
| 312 | + type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path), |
| 313 | + default=None, |
| 314 | + help="SSL certificate file", |
| 315 | +) |
| 316 | +@click.option( |
| 317 | + "--ssl-keyfile", |
| 318 | + type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True, path_type=pathlib.Path), |
| 319 | + default=None, |
| 320 | + help="SSL key file", |
| 321 | +) |
301 | 322 | @pass_script_info
|
302 | 323 | def serve_command(
|
303 | 324 | info,
|
|
0 commit comments