Skip to content

Commit d980733

Browse files
committed
3.0 uri params: SSL instance sample (net.box)
1 parent 16379ef commit d980733

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

doc/code_snippets/snippets/config/instances.enabled/ssl/config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ groups:
2121
replicaset001:
2222
instances:
2323
instance001: { }
24+
25+
app:
26+
file: 'myapp.lua'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function connect()
2+
local connection = require('net.box').connect({
3+
uri = 'admin:[email protected]:3301',
4+
params = { transport = 'ssl',
5+
ssl_cert_file = 'test_certs/server.crt',
6+
ssl_key_file = 'test_certs/server.key' }
7+
})
8+
return connection
9+
end

doc/enterprise/security.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,11 @@ In the :ref:`next section <enterprise-iproto-encryption-config-sc>`, you can fin
440440

441441
Example:
442442

443-
.. code-block:: lua
444-
445-
c = require('net.box').connect({
446-
uri = 'localhost:3301',
447-
params = {transport = 'ssl'}
448-
})
443+
.. literalinclude:: /code_snippets/snippets/config/instances.enabled/ssl/myapp.lua
444+
:language: lua
445+
:start-at: net.box
446+
:end-before: return connection
447+
:dedent:
449448

450449
* ``ssl_key_file`` -- a path to a private SSL key file.
451450
Mandatory for a server.

0 commit comments

Comments
 (0)