Skip to content

Commit

Permalink
Updated checking for key and cert files.
Browse files Browse the repository at this point in the history
  • Loading branch information
drmats committed Jan 25, 2014
1 parent c04888b commit 8fe143f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fup.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ def run_server (self, host, port, config):
)
os.kill(config["ppid"], signal.SIGINT)
return

if not os.path.isfile(config["cert"]):
print(
"Provide a valid path to SSL certificate " + \
Expand All @@ -746,7 +745,6 @@ def run_server (self, host, port, config):
)
os.kill(config["ppid"], signal.SIGINT)
return

try:
import ssl
httpd.socket = \
Expand All @@ -773,6 +771,10 @@ def run_server (self, host, port, config):
)
os.kill(config["ppid"], signal.SIGINT)
return
elif os.path.isfile(config["key"]) or os.path.isfile(config["cert"]):
print("Use --ssl switch.", file=sys.stderr)
os.kill(config["ppid"], signal.SIGINT)
return

print(
"listening on %s:%u%s" \
Expand Down

0 comments on commit 8fe143f

Please sign in to comment.