<ahref="_s_s_l_client_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">/* Copyright 2019 OSU OPEnS Lab</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy of this</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> * software and associated documentation files (the "Software"), to deal in the Software</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * without restriction, including without limitation the rights to use, copy, modify,</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> * permit persons to whom the Software is furnished to do so, subject to the following</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> * conditions:</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> * copies or substantial portions of the Software.</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment"> *</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,</span></div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A</span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="comment"> * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE</span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment"> * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> */</span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> </div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="preprocessor">#include "Client.h"</span></div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="preprocessor">#include "<aclass="code"href="_s_s_l_session_8h.html">SSLSession.h</a>"</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="preprocessor">#include "<aclass="code"href="_s_s_l_client_parameters_8h.html">SSLClientParameters.h</a>"</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="p
<divclass="ttc"id="class_s_s_l_session_html"><divclass="ttname"><ahref="class_s_s_l_session.html">SSLSession</a></div><divclass="ttdoc">This class stores values which allow SSLClient to save and resume SSL sessions.</div><divclass="ttdef"><b>Definition:</b> SSLSession.h:51</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a8da354f30537c1064d554921937a73ae"><divclass="ttname"><ahref="class_s_s_l_client.html#a8da354f30537c1064d554921937a73ae">SSLClient::setTimeout</a></div><divclass="ttdeci">void setTimeout(unsigned int t)</div><divclass="ttdoc">Set the timeout when waiting for an SSL response.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:365</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a68f026a625ca1ccd1aba87bb6e670376"><divclass="ttname"><ahref="class_s_s_l_client.html#a68f026a625ca1ccd1aba87bb6e670376">SSLClient::SSLClient</a></div><divclass="ttdeci">SSLClient(Client &client, const br_x509_trust_anchor *trust_anchors, const size_t trust_anchors_num, const int analog_pin, const size_t max_sessions=1, const DebugLevel debug=SSL_WARN)</div><divclass="ttdoc">Initialize SSLClient with all of the prerequisites needed.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:55</div></div>
<divclass="ttc"id="class_s_s_l_client_html_aaf2192a6621fdf2f89cc26a9a1584f8c"><divclass="ttname"><ahref="class_s_s_l_client.html#aaf2192a6621fdf2f89cc26a9a1584f8c">SSLClient::flush</a></div><divclass="ttdeci">void flush() override</div><divclass="ttdoc">Force writing the buffered bytes from SSLClient::write to the network.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:218</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a2bd012ef6f01df9694ba9fd0a3c227c3"><divclass="ttname"><ahref="class_s_s_l_client.html#a2bd012ef6f01df9694ba9fd0a3c227c3">SSLClient::getSession</a></div><divclass="ttdeci">SSLSession * getSession(const char *host)</div><divclass="ttdoc">Gets a session reference corresponding to a host and IP, or a reference to a empty session if none ex...</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:282</div></div>
<divclass="ttc"id="struct_s_s_l_client_parameters_html"><divclass="ttname"><ahref="struct_s_s_l_client_parameters.html">SSLClientParameters</a></div><divclass="ttdoc">This struct stores data required for SSLClient to use mutual authentication.</div><divclass="ttdef"><b>Definition:</b> SSLClientParameters.h:52</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a9e7ce7f8a72d7cdc071be3fa7a4c8f29"><divclass="ttname"><ahref="class_s_s_l_client.html#a9e7ce7f8a72d7cdc071be3fa7a4c8f29">SSLClient::setMutualAuthParams</a></div><divclass="ttdeci">void setMutualAuthParams(const SSLClientParameters *params)</div><divclass="ttdoc">Add a client certificate and enable support for mutual auth.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:306</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a0e775669b4a040fbd3f281dcbcd2de78"><divclass="ttname"><ahref="class_s_s_l_client.html#a0e775669b4a040fbd3f281dcbcd2de78">SSLClient::available</a></div><divclass="ttdeci">int available() override</div><divclass="ttdoc">Returns the number of bytes available to read from the data that has been received and decrypted.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:170</div></div>
<divclass="ttc"id="class_s_s_l_client_html"><divclass="ttname"><ahref="class_s_s_l_client.html">SSLClient</a></div><divclass="ttdoc">The main SSLClient class. Check out README.md for more info.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:35</div></div>
<divclass="ttc"id="class_s_s_l_client_html_ab97c0745f65a6c6009ac938b3b9912c3"><divclass="ttname"><ahref="class_s_s_l_client.html#ab97c0745f65a6c6009ac938b3b9912c3">SSLClient::connect</a></div><divclass="ttdeci">int connect(IPAddress ip, uint16_t port) override</div><divclass="ttdoc">Connect over SSL to a host specified by an IP address.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:82</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a03c7926938acd57cfc3b982edf725a86"><divclass="ttname"><ahref="class_s_s_l_client.html#a03c7926938acd57cfc3b982edf725a86">SSLClient::write</a></div><divclass="ttdeci">size_t write(const uint8_t *buf, size_t size) override</div><divclass="ttdoc">Write some bytes to the SSL connection.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:127</div></div>
<divclass="ttc"id="class_s_s_l_client_html_aef1b52f4ad9633126cb68739175920eb"><divclass="ttname"><ahref="class_s_s_l_client.html#aef1b52f4ad9633126cb68739175920eb">SSLClient::read</a></div><divclass="ttdeci">int read() override</div><divclass="ttdoc">Read a single byte, or -1 if none is available.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:258</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a48239f60f1b4318cc112706fc40c6cea"><divclass="ttname"><ahref="class_s_s_l_client.html#a48239f60f1b4318cc112706fc40c6cea">SSLClient::Error</a></div><divclass="ttdeci">Error</div><divclass="ttdoc">Static constants defining the possible errors encountered.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:45</div></div>
<divclass="ttc"id="class_s_s_l_client_html_af632625f8d247f3885c81e1f05043ad1"><divclass="ttname"><ahref="class_s_s_l_client.html#af632625f8d247f3885c81e1f05043ad1">SSLClient::DebugLevel</a></div><divclass="ttdeci">DebugLevel</div><divclass="ttdoc">Level of verbosity used in logging for SSLClient.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:67</div></div>
<divclass="ttc"id="class_s_s_l_client_html_ae3f9e6f8e8a50e520c936239abecfd22"><divclass="ttname"><ahref="class_s_s_l_client.html#ae3f9e6f8e8a50e520c936239abecfd22">SSLClient::getSessionCount</a></div><divclass="ttdeci">size_t getSessionCount() const</div><divclass="ttdoc">Get the maximum number of SSL sessions that can be stored at once.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:349</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a0c0b6f2ad25701d1e45adb613d072d86"><divclass="ttname"><ahref="class_s_s_l_client.html#a0c0b6f2ad25701d1e45adb613d072d86">SSLClient::peek</a></div><divclass="ttdeci">int peek() override</div><divclass="ttdoc">View the first byte of the buffer, without removing it from the SSLClient Buffer.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:206</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a7343a58457b4659f83b61cac1f442c3d"><divclass="ttname"><ahref="class_s_s_l_client.html#a7343a58457b4659f83b61cac1f442c3d">SSLClient::write</a></div><divclass="ttdeci">size_t write(uint8_t b) override</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:210</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a9a4e9c9877ab73cf7e82d6942cc7db21"><divclass="ttname"><ahref="class_s_s_l_client.html#a9a4e9c9877ab73cf7e82d6942cc7db21">SSLClient::getClient</a></div><divclass="ttdeci">Client & getClient()</div><divclass="ttdoc">Returns a reference to the client object stored in this class. Take care not to break it.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:359</div></div>
<divclass="ttc"id="class_s_s_l_client_html_ad5d9d8a4187a3f8918bf66af83e733c4"><divclass="ttname"><ahref="class_s_s_l_client.html#ad5d9d8a4187a3f8918bf66af83e733c4">SSLClient::removeSession</a></div><divclass="ttdeci">void removeSession(const char *host)</div><divclass="ttdoc">Clear the session corresponding to a host and IP.</div><divclass="ttdef"><b>Definition:</b> SSLClient.cpp:295</div></div>
<divclass="ttc"id="class_s_s_l_client_html_a2a178251978e0622f7e241da702ae498"><divclass="ttname"><ahref="class_s_s_l_client.html#a2a178251978e0622f7e241da702ae498">SSLClient::getTimeout</a></div><divclass="ttdeci">unsigned int getTimeout() const</div><divclass="ttdoc">Get the timeout when waiting for an SSL response.</div><divclass="ttdef"><b>Definition:</b> SSLClient.h:371</div></div>