Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / ryu / doc / source / tls.rst
1 ********************
2 Setup TLS Connection
3 ********************
4
5 If you want to use secure channel to connect OpenFlow switches, you
6 need to use TLS connection. This document describes how to setup Ryu
7 to connect to the Open vSwitch over TLS.
8
9
10 Configuring a Public Key Infrastructure
11 ========================================
12
13 If you don't have a PKI, the ovs-pki script included with Open vSwitch
14 can help you. This section is based on the INSTALL.SSL in the Open
15 vSwitch source code.
16
17 NOTE: How to install Open vSwitch isn't described in this
18 document. Please refer to the Open vSwitch documents.
19
20
21 Create a PKI by using ovs-pki script::
22
23     % ovs-pki init
24     (Default directory is /usr/local/var/lib/openvswitch/pki)
25
26 The pki directory consists of controllerca and switchca
27 subdirectories. Each directory contains CA files.
28
29
30 Create a controller private key and certificate::
31
32     % ovs-pki req+sign ctl controller
33
34 ctl-privkey.pem and ctl-cert.pem are generated in the current
35 directory.
36
37
38 Create a switch private key and certificate::
39
40     % ovs-pki req+sign sc switch
41
42 sc-privkey.pem and sc-cert.pem are generated in the current directory.
43
44
45 Testing TLS Connection
46 ======================
47
48 Configuring ovs-vswitchd to use CA files using the ovs-vsctl "set-ssl"
49 command, e.g.::
50
51     % ovs-vsctl set-ssl /etc/openvswitch/sc-privkey.pem \
52       /etc/openvswitch/sc-cert.pem \
53       /usr/local/var/lib/openvswitch/pki/controllerca/cacert.pem
54     % ovs-vsctl add-br br0
55     % ovs-vsctl set-controller br0 ssl:127.0.0.1:6633
56
57 Substitute the correct file names, if they differ from the ones used
58 above. You should use absolute file names.
59
60
61 Run Ryu with CA files::
62
63     % ryu-manager --ctl-privkey ctl-privkey.pem \
64                   --ctl-cert ctl-cert.pem \
65                   --ca-certs /usr/local/var/lib/openvswitch/pki/switchca/cacert.pem \
66                   --verbose
67
68 You can see something like::
69
70     loading app ryu.controller.ofp_handler
71     instantiating app ryu.controller.ofp_handler
72     BRICK ofp_event
73       CONSUMES EventOFPSwitchFeatures
74       CONSUMES EventOFPErrorMsg
75       CONSUMES EventOFPHello
76       CONSUMES EventOFPEchoRequest
77     connected socket:<SSLSocket fileno=4 sock=127.0.0.1:6633 peer=127.0.0.1:61302> a
78     ddress:('127.0.0.1', 61302)
79     hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x1047806d0>
80     move onto config mode
81     switch features ev version: 0x1 msg_type 0x6 xid 0xb0bb34e5 port OFPPhyPort(port
82     _no=65534, hw_addr='\x16\xdc\xa2\xe2}K', name='br0\x00\x00\x00\x00\x00\x00\x00\x
83     00\x00\x00\x00\x00\x00', config=0, state=0, curr=0, advertised=0, supported=0, p
84     eer=0)
85     move onto main mode
86