Fix bug when reloading config with SSL enabled
This commit is contained in:
@@ -7,6 +7,7 @@ import ipaddress
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import signal
|
import signal
|
||||||
|
import socket
|
||||||
import ssl
|
import ssl
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
@@ -648,9 +649,10 @@ def run_daemon(app):
|
|||||||
app.config["daemon"]["ssl_cert_file"],
|
app.config["daemon"]["ssl_cert_file"],
|
||||||
app.config["daemon"]["ssl_key_file"]
|
app.config["daemon"]["ssl_key_file"]
|
||||||
)
|
)
|
||||||
# Note: existing connections use old cert, new connections use new
|
fd = server.socket.detach()
|
||||||
|
raw_socket = socket.socket(fileno=fd)
|
||||||
server.socket = new_context.wrap_socket(
|
server.socket = new_context.wrap_socket(
|
||||||
server.socket.detach(), server_side=True
|
raw_socket, server_side=True
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Config reload failed: {e}")
|
logging.error(f"Config reload failed: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user