Skip to content

Commit 9e6f0cc

Browse files
committed
Add distributed Erlang TLS documentation for Windows
Fixes #426 and [159602360] Also see rabbitmq/rabbitmq-server#1666
1 parent bf1b4df commit 9e6f0cc

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

site/clustering-ssl.xml

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ CTL_ERL_ARGS="-pa $ERL_SSL_PATH \
202202
commands will look like these:</p>
203203

204204
<pre class="sourcecode bash">
205-
echo erts-6.1/bin/erl -boot releases/3.4.3/start_clean \
206-
-eval 'io:format("~p", [code:lib_dir(ssl, ebin)]),halt().' -noshell
205+
erl -boot releases/3.4.3/start_clean \
206+
-eval 'io:format("ERL_SSL_PATH=~s~n", [filename:dirname(code:which(inet_tls_dist))])' -s init stop
207207
"/path/to/erl/lib/ssl-5.3.5/ebin"
208208
export ERL_SSL_PATH=/path/to/erl/lib/ssl-5.3.5/ebin
209209
</pre>
@@ -225,9 +225,72 @@ export ERL_SSL_PATH=/path/to/erl/lib/ssl-5.3.5/ebin
225225

226226
<doc:section name="how-to-windows">
227227
<doc:heading>Windows</doc:heading>
228+
<p>There are some minor differences when configuring TLS for distributed Erlang on Windows.
229+
First, the command to find the location of the <code>inet_tls_dist</code> module is
230+
different due to shell parsing rules:
231+
</p>
232+
233+
<pre class="sourcecode bash">
234+
erl -noinput -eval "io:format(""ERL_SSL_PATH=~s~n"", [filename:dirname(code:which(inet_tls_dist))])" -s init stop
235+
</pre>
236+
237+
<p>Next, the file containing the custom environment variables is named <code>rabbitmq-env-conf.bat</code> on Windows.
238+
This file <em>must</em> be saved to the <code>%AppData%\RabbitMQ</code> directory of the administrative
239+
user that installed RabbitMQ.
240+
</p>
241+
<p>Here is a complete <code>rabbitmq-env-conf.bat</code> file using the <code>-ssl_dist_opfile</code> setting.
242+
Note the use of forward-slash directory delimiters.
243+
</p>
244+
245+
<pre class="sourcecode bash">
246+
@echo off
247+
rem NOTE: If spaces are present in any of these paths,
248+
rem double quotes must be used.
249+
250+
rem NOTE: the following path is **system dependent**.
251+
set SSL_PATH="C:/Program Files/erl10.0.1/lib/ssl-9.0/ebin"
228252

229-
<p>TBD.</p>
253+
rem NOTE: pre-RabbitMQ 3.7.8 variable names:
254+
set RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-pa %SSL_PATH% ^
255+
-proto_dist inet_tls ^
256+
-ssl_dist_optfile C:/Users/rmq_user/AppData/Roaming/RabbitMQ/ssl_dist.config
230257

258+
set RABBITMQ_CTL_ERL_ARGS=-pa %SSL_PATH% ^
259+
-proto_dist inet_tls ^
260+
-ssl_dist_optfile C:/Users/rmq_user/AppData/Roaming/RabbitMQ/ssl_dist.config
261+
262+
rem NOTE: post-RabbitMQ 3.7.8 variable names:
263+
rem set SERVER_ADDITIONAL_ERL_ARGS=...
264+
rem set CTL_ERL_ARGS=...
265+
266+
rem See this PR for details
267+
rem https://github.com/rabbitmq/rabbitmq-server/pull/1666
268+
</pre>
269+
270+
<p>Finally, here is an example <code>ssl_dist.config</code> file.
271+
Note that, as with Unix systems, more ssl options are available
272+
to be set here if necessary.</p>
273+
274+
<pre class="sourcecode bash">
275+
[
276+
{server, [
277+
{cacertfile, "C:/Path/To/ca_certificate.pem"},
278+
{certfile, "C:/Path/To/server_certificate.pem"},
279+
{keyfile, "C:/Path/To/server_key.pem"},
280+
{secure_renegotiate, true},
281+
{verify, verify_peer},
282+
{fail_if_no_peer_cert, true}
283+
]},
284+
{client, [
285+
{cacertfile, "C:/Path/To/ca_certificate.pem"},
286+
{certfile, "C:/Path/To/client_certificate.pem"},
287+
{keyfile, "C:/Path/To/client_key.pem"},
288+
{secure_renegotiate, true},
289+
{verify, verify_peer},
290+
{fail_if_no_peer_cert, true}
291+
]}
292+
].
293+
</pre>
231294
</doc:section>
232295
</body>
233296
</html>

0 commit comments

Comments
 (0)