]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : fix the log message when using SSL (#23393)
authorRadoslav Gerganov <redacted>
Wed, 27 May 2026 05:06:30 +0000 (08:06 +0300)
committerGitHub <redacted>
Wed, 27 May 2026 05:06:30 +0000 (08:06 +0300)
When llama-server is started with SSL key and cert, the log says that it
listens on http instead of https. This patch fixes this.

tools/server/server-http.cpp
tools/server/server-http.h

index 9c025952d5d6a60be7d0828388782ce64dab5d0d..c0a9af8f09246858e519ed31f40c0ffa1b96e645 100644 (file)
@@ -99,6 +99,7 @@ bool server_http_context::init(const common_params & params) {
         srv.reset(
             new httplib::SSLServer(params.ssl_file_cert.c_str(), params.ssl_file_key.c_str())
         );
+        is_ssl = true;
     } else {
         SRV_INF("%s", "running without SSL\n");
         srv.reset(new httplib::Server());
@@ -378,8 +379,8 @@ bool server_http_context::start() {
     thread = std::thread([this]() { pimpl->srv->listen_after_bind(); });
     srv->wait_until_ready();
 
-    listening_address = is_sock ? string_format("unix://%s",    hostname.c_str())
-                                : string_format("http://%s:%d", hostname.c_str(), port);
+    listening_address = is_sock ? string_format("unix://%s", hostname.c_str())
+                                : string_format("%s://%s:%d", is_ssl ? "https" : "http", hostname.c_str(), port);
     return true;
 }
 
index 66ee555f501aaba726b49d73c0e824a8652b15fd..099b5e1cc6f260af2c25a4451a658b6549500ad5 100644 (file)
@@ -74,6 +74,7 @@ struct server_http_context {
     std::string path_prefix;
     std::string hostname;
     int port;
+    bool is_ssl = false;
 
     server_http_context();
     ~server_http_context();