From 33e72567dc4f8f745be986190be08db847f423d0 Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov@tarantool.org>
Date: Mon, 16 Oct 2023 15:53:47 +0300
Subject: [PATCH] console: forward original URI to net.box when connecting over
 IPROTO

Tarantool supports two console protocols: text and binary. The binary
protocol is implemented with IPROTO EVAL request so the console module
reuses the net.box module to establish and maintain a binary connection.
Currently, instead of passing the original URI specified by the user to
net.box.connect as is, the console module parses the URI and passes the
host and port. As a result, extra information that may be specified in
URI parameters is lost. This prevents the user from connecting to the
binary console using the SSL transport because to use the SSL transport
the user must specify transport=ssl URI parameter.

Needed for tarantool/tarantool-ee#567

NO_DOC=no visible changes in CE
NO_TEST=no visible changes in CE
NO_CHANGELOG=no visible changes in CE
---
 src/box/lua/console.lua | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/box/lua/console.lua b/src/box/lua/console.lua
index 05ea4aaf28..90111ccade 100644
--- a/src/box/lua/console.lua
+++ b/src/box/lua/console.lua
@@ -919,11 +919,7 @@ local function connect(uri, opts)
     -- We don't know if the remote end is binary or Lua console so we first try
     -- to connect to it as binary using net.box and fall back on Lua console if
     -- it fails.
-    local remote = net_box.connect(u.host, u.service, {
-            connect_timeout = opts.timeout,
-            user = u.login,
-            password = u.password,
-    })
+    local remote = net_box.connect(uri, {connect_timeout = opts.timeout})
     if remote.state == 'error' then
         local err = remote.error
         remote = nil
-- 
GitLab