aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/doc/src/ssl_app.xml
blob: fb395f8ffa9a47fc18305c44d4ba90b667e549e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE appref SYSTEM "appref.dtd">

<appref>
  <header>
    <copyright>
      <year>1999</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

    </legalnotice>

    <title>ssl</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
    <file>ssl_app.sgml</file>
  </header>
  <app>ssl</app>
  <appsummary>The ssl application provides secure communication over
  sockets.</appsummary>

  <description>
    <p>
      The ssl application is an implementation of the SSL/TLS/DTLS protocol in Erlang.
    </p>
    <list type="bulleted">
      <item>Supported SSL/TLS/DTLS-versions are SSL-3.0, TLS-1.0,
      TLS-1.1, TLS-1.2, DTLS-1.0 (based on TLS-1.1), DTLS-1.2 (based on TLS-1.2)</item>
      <item>For security reasons SSL-2.0 is not supported.</item>
      <item>For security reasons SSL-3.0 is no longer supported by default,
      but can be configured.</item>
      <item>For security reasons DES cipher suites are no longer supported by default,
      but can be configured.</item>
      <item> Renegotiation Indication Extension <url href="http://www.ietf.org/rfc/rfc5746.txt">RFC 5746</url> is supported
      </item>
      <item>Ephemeral Diffie-Hellman cipher suites are supported,
      but not Diffie Hellman Certificates cipher suites.</item>
      <item>Elliptic Curve cipher suites are supported if the Crypto 
      application supports it and named curves are used.
      </item>
      <item>Export cipher suites are not supported as the
      U.S. lifted its export restrictions in early 2000.</item>
      <item>IDEA cipher suites are not supported as they have
      become deprecated by the latest TLS specification so it is not 
      motivated to implement them.</item>
      <item>Compression is not supported.</item>
      <item>CRL validation is supported.</item>
      <item>Policy certificate extensions are not supported.</item>
      <item>'Server Name Indication' extension
      (<url href="http://www.ietf.org/rfc/rfc6066.txt">RFC 6066</url>) is supported.</item>
      <item>Application Layer Protocol Negotiation (ALPN) and its successor Next Protocol Negotiation (NPN)
      are supported. </item>
      <item>It is possible to use Pre-Shared Key (PSK) and Secure Remote Password (SRP)
      cipher suites, but they are not enabled by default.
      </item>
    </list>
   </description>

  <section>
    <title>DEPENDENCIES</title>
    <p>The SSL application uses the <c>public_key</c>, <c>asn1</c> and
    Crypto application to handle public keys and encryption, hence
    these applications must be loaded for the SSL application to work. 
    In an embedded environment this means they must be started with
    <c>application:start/[1,2]</c> before the SSL application is 
    started.</p>
  </section>

  <section>
    <title>CONFIGURATION</title>
    <p>The application environment configuration parameters in this section 
    are defined for the SSL application. For more information 
    about configuration parameters, see the 
    <seealso marker="kernel:application">application(3)</seealso>
    manual page in Kernel.</p>

    <p>The environment parameters can be set on the command line,
    for example:</p>

    <p><c>erl -ssl protocol_version "['tlsv1.2', 'tlsv1.1']"</c></p>

    <taglist>
      <tag><c>protocol_version = </c><seealso marker="ssl#type-protocol">ssl:ssl_tls_protocol()</seealso><c><![CDATA[<optional>]]></c></tag>
      <item><p>Protocol supported by started clients and
      servers. If this option is not set, it defaults to all
      TLS protocols currently supported by the SSL application.
      This option can be overridden by the version option
      to <c>ssl:connect/[2,3]</c> and <c>ssl:listen/2</c>.</p></item>

      <tag><c>dtls_protocol_version = </c><seealso marker="ssl#type-protocol">ssl:dtls_protocol()</seealso><c><![CDATA[<optional>]]></c></tag>
      <item><p>Protocol supported by started clients and
      servers. If this option is not set, it defaults to all
      DTLS protocols currently supported by the SSL application.
      This option can be overridden by the version option
      to <c>ssl:connect/[2,3]</c> and <c>ssl:listen/2</c>.</p></item>
      
      <tag><c><![CDATA[session_lifetime = integer() <optional>]]></c></tag>
      <item><p>Maximum lifetime of the session data in seconds. Defaults to 24 hours which is the maximum
      recommended lifetime by <url href="http://www.ietf.org/rfc/5246rfc.txt">RFC 5246</url>. However
      sessions may be invalidated earlier due to the maximum limitation of the session cache table.
      </p></item>

      <tag><c><![CDATA[session_cb = atom() <optional>]]></c></tag>
      <item><p>Name of the session cache callback module that implements
      the <c>ssl_session_cache_api</c> behavior. Defaults to
      <c>ssl_session_cache</c>.</p></item>

      <tag><c><![CDATA[session_cb_init_args = proplist:proplist() <optional>]]></c></tag>

      <item><p>List of extra user-defined arguments to the <c>init</c> function
      in the session cache callback module. Defaults to <c>[]</c>.</p></item>

      <tag><c><![CDATA[session_cache_client_max = integer() <optional>]]></c><br/></tag>
      <item><p>Limits the growth of the clients session cache, that is
      how many sessions towards servers that are cached to be used by
      new client connections.  If the maximum number of sessions is
      reached, the current cache entries will be invalidated
      regardless of their remaining lifetime. Defaults to
      1000. Recommended ssl-8.2.1 or later for this option to work as intended.</p></item>

      <tag> <c><![CDATA[session_cache_server_max = integer() <optional>]]></c></tag>
      <item><p>Limits the growth of the servers session cache, that is
      how many client sessions are cached by the server. If the
      maximum number of sessions is reached, the current cache entries
      will be invalidated regardless of their remaining
      lifetime. Defaults to 1000. Recommended ssl-8.2.1 or later for this option to work as intended.</p></item>
      
      <tag><c><![CDATA[ssl_pem_cache_clean = integer() <optional>]]></c></tag>
      <item>
	<p>
	  Number of milliseconds between PEM cache validations. Defaults to 2 minutes.
	</p>
	<seealso
	    marker="ssl#clear_pem_cache-0">ssl:clear_pem_cache/0</seealso>
	
      </item>

      <tag><c><![CDATA[bypass_pem_cache = boolean() <optional>]]></c></tag>
      <item>
	<p>Introduced in ssl-8.0.2. Disables the PEM-cache.
	Can be used as a workaround for the PEM-cache bottlneck
	before ssl-8.1.1. Defaults to false.
	</p>
      </item>
      
      <tag><c><![CDATA[alert_timeout = integer() <optional>]]></c></tag>
      <item>
	<p>
	  Number of milliseconds between sending of a fatal alert and
	  closing the connection. Waiting a little while improves the
	  peers chances to properly receiving the alert so it may
	  shutdown gracefully. Defaults to 5000 milliseconds.   
	</p>
      </item>
    </taglist>
  </section>

  <section>
    <title>ERROR LOGGER AND EVENT HANDLERS</title>
    <p>The SSL application uses the default <seealso
    marker="kernel:error_logger">OTP error logger</seealso> to log
    unexpected errors and TLS/DTLS alerts. The logging of TLS/DTLS alerts may be
    turned off with the <c>log_alert</c> option. </p>
  </section>

  <section>
    <title>SEE ALSO</title>
	<p><seealso marker="kernel:application">application(3)</seealso></p>
  </section>
  
</appref>