Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2da3784

Browse files
committed
Merge pull requestcpp-netlib#398 from jellevdd/0.11-devel-integration
Add documentation for SSL support, fix shutdown issues with exceptions.
2 parents3aed2f2 +09bce96 commit2da3784

File tree

45 files changed

+470
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+470
-125
lines changed

‎boost/network/protocol/stream_handler.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ namespace boost { namespace network {
114114
{
115115
try {
116116
if(ssl_enabled) {
117-
returnssl_sock_->shutdown();
117+
ssl_sock_->shutdown(e);
118118
}else {
119-
returntcp_sock_->shutdown(boost::asio::ip::tcp::socket::shutdown_send);
119+
tcp_sock_->shutdown(boost::asio::ip::tcp::socket::shutdown_send,e);
120120
}
121121
}catch(const boost::system::error_code & e) {
122122
std::cerr << e.message() << std::endl;

‎libs/network/doc/html/.buildinfo‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config:ae3dc7fdd27083cd0960e8fba1dd2084
3+
config:247e8c3d216dc851efe8ee3a759ed678
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

‎libs/network/doc/html/_sources/reference/http_client.txt‎

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -168,40 +168,50 @@ initialization.
168168
Constructor taking a ``client_options<Tag>`` object. The following table
169169
shows the options you can set on a ``client_options<Tag>`` instance.
170170

171-
+---------------------+----------------------------+--------------------------+
172-
| Parameter Name | Type | Description |
173-
+=====================+============================+==========================+
174-
| follow_redirects | ``bool`` | Boolean to specify |
175-
| | | whether the client |
176-
| | | should follow HTTP |
177-
| | | redirects. Default is |
178-
| | | ``false``. |
179-
+---------------------+----------------------------+--------------------------+
180-
| cache_resolved | ``bool`` | Boolean to specify |
181-
| | | whether the client |
182-
| | | should cache resolved |
183-
| | | endpoints. The default |
184-
| | | is ``false``. |
185-
+---------------------+----------------------------+--------------------------+
186-
| io_service | ``shared_ptr<io_service>`` | Shared pointer to a |
187-
| | | Boost.Asio |
188-
| | | ``io_service``. |
189-
+---------------------+----------------------------+--------------------------+
190-
| openssl_certificate | ``string`` | The filename of the |
191-
| | | certificate to load for |
192-
| | | the SSL connection for |
193-
| | | verification. |
194-
+---------------------+----------------------------+--------------------------+
195-
| openssl_verify_path | ``string`` | The directory from |
196-
| | | which the certificate |
197-
| | | authority files are |
198-
| | | located. |
199-
+---------------------+----------------------------+--------------------------+
200-
| always_verify_peer | ``bool`` | Boolean to specify |
201-
| | | whether the client |
202-
| | | should always verify |
203-
| | | peers in SSL connections |
204-
+---------------------+----------------------------+--------------------------+
171+
+--------------------------+----------------------------+--------------------------+
172+
| Parameter Name | Type | Description |
173+
+==========================+============================+==========================+
174+
| follow_redirects | ``bool`` | Boolean to specify |
175+
| | | whether the client |
176+
| | | should follow HTTP |
177+
| | | redirects. Default is |
178+
| | | ``false``. |
179+
+--------------------------+----------------------------+--------------------------+
180+
| cache_resolved | ``bool`` | Boolean to specify |
181+
| | | whether the client |
182+
| | | should cache resolved |
183+
| | | endpoints. The default |
184+
| | | is ``false``. |
185+
+--------------------------+----------------------------+--------------------------+
186+
| io_service | ``shared_ptr<io_service>`` | Shared pointer to a |
187+
| | | Boost.Asio |
188+
| | | ``io_service``. |
189+
+--------------------------+----------------------------+--------------------------+
190+
| openssl_certificate | ``string`` | The filename of the |
191+
| | | certificate to load for |
192+
| | | the SSL connection for |
193+
| | | verification. |
194+
+--------------------------+----------------------------+--------------------------+
195+
| openssl_verify_path | ``string`` | The directory from |
196+
| | | which the certificate |
197+
| | | authority files are |
198+
| | | located. |
199+
+--------------------------+----------------------------+--------------------------+
200+
| always_verify_peer | ``bool`` | Boolean to specify |
201+
| | | whether the client |
202+
| | | should always verify |
203+
| | | peers in SSL connections |
204+
+--------------------------+----------------------------+--------------------------+
205+
| openssl_certificate_file | ``string`` | Filename of the |
206+
| | | certificate to use for |
207+
| | | client-side SSL session |
208+
| | | establishment. |
209+
+--------------------------+----------------------------+--------------------------+
210+
| openssl_private_key_file | ``string`` | Filename of the |
211+
| | | private key to use for |
212+
| | | client-side SSL session |
213+
| | | establishment. |
214+
+--------------------------+----------------------------+--------------------------+
205215

206216

207217
To use the above supported named parameters, you'll have code that looks like

‎libs/network/doc/html/_sources/reference/http_server.txt‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ Constructor
217217
| linger_timeout | ``int`` | An optional int to define the timeout to wait for socket closes before it is set to linger. |
218218
| | | The default is ``0``. |
219219
+-----------------------+------------------------------------------+--------------------------------------------------------------------------------------------------+
220+
| context | ``shared_ptr<context>`` | An optional shared pointer to an instance of ``boost::asio::ssl::context`` -- this contains the |
221+
| | | settings needed to support SSL. This parameter is only applicable for ``async_server`` instances.|
222+
+-----------------------+------------------------------------------+--------------------------------------------------------------------------------------------------+
220223

221224
To use the above supported named parameters, you'll have code that looks like the following:
222225

@@ -524,6 +527,41 @@ primary means for reading from and writing to the connection.
524527
The function throws an instance of ``std::logic_error`` if you try to set
525528
the headers for a connection more than once.
526529

530+
Adding SSL support to Asynchronous Server
531+
-----------------------------------------
532+
533+
In order to setup SSL support for an Asynchronous Server, it is best to start from
534+
a regular Asynchronous Server (see above). Once this server is setup, SSL can be
535+
enabled by adding a Boost.Asio.Ssl.Context_ to the options. The settings that can be
536+
used are defined in the link.
537+
538+
.. code-block:: c++
539+
540+
// Initialize SSL context
541+
boost::shared_ptr<boost::asio::ssl::context> ctx = boost::make_shared<boost::asio::ssl::context>(boost::asio::ssl::context::sslv23);
542+
ctx->set_options(
543+
boost::asio::ssl::context::default_workarounds
544+
| boost::asio::ssl::context::no_sslv2
545+
| boost::asio::ssl::context::single_dh_use);
546+
547+
// Set keys
548+
ctx->set_password_callback(password_callback);
549+
ctx->use_certificate_chain_file("server.pem");
550+
ctx->use_private_key_file("server.pem", boost::asio::ssl::context::pem);
551+
ctx->use_tmp_dh_file("dh512.pem");
552+
553+
handler_type handler;
554+
http_server::options options(handler);
555+
options.thread_pool(boost::make_shared<boost::network::utils::thread_pool>(2));
556+
http_server server(options.address("127.0.0.1").port("8442").context(ctx));
557+
558+
559+
.. code-block:: c++
527560

561+
std::string password_callback(std::size_t max_length, boost::asio::ssl::context_base::password_purpose purpose) {
562+
return std::string("test");
563+
}
564+
528565
.. _Boost.Range: http://www.boost.org/libs/range
529566
.. _Boost.Function: http://www.boost.org/libs/function
567+
.. _Boost.Asio.SSL.Context: http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/reference/ssl__context.html

‎libs/network/doc/html/_sources/whats_new.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ v0.11.0
2727
``cpp-netlib-utils_base64_test`` still fails in this platform. (`#287`_)
2828
* Provide a client option to always validate peers for HTTPS requests made by
2929
the client. (`#349`_)
30+
* Back-port fix for `#163`_ for improved URI parsing.
31+
* Added support for client-side certificates and private keys (`#361`_).
3032

3133
.. _`#129`: https://github.com/cpp-netlib/cpp-netlib/issues/129
34+
.. _`#163`: https://github.com/cpp-netlib/cpp-netlib/issues/163
3235
.. _`#245`: https://github.com/cpp-netlib/cpp-netlib/issues/245
3336
.. _`#277`: https://github.com/cpp-netlib/cpp-netlib/issues/277
3437
.. _`#279`: https://github.com/cpp-netlib/cpp-netlib/issues/279
@@ -40,6 +43,7 @@ v0.11.0
4043
.. _`#349`: https://github.com/cpp-netlib/cpp-netlib/issues/349
4144
.. _`#69`: https://github.com/cpp-netlib/cpp-netlib/issues/69
4245
.. _`#86`: https://github.com/cpp-netlib/cpp-netlib/issues/86
46+
.. _`#361`: https://github.com/cpp-netlib/cpp-netlib/pull/361
4347

4448
:mod:`cpp-netlib` 0.10
4549
----------------------

‎libs/network/doc/html/_static/basic.css‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- basic theme.
66
*
7-
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
@@ -89,6 +89,7 @@ div.sphinxsidebar #searchbox input[type="submit"] {
8989

9090
img {
9191
border:0;
92+
max-width:100%;
9293
}
9394

9495
/* -- search page ----------------------------------------------------------- */

‎libs/network/doc/html/_static/doctools.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx JavaScript utilities for all documentation.
66
*
7-
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
@@ -168,6 +168,9 @@ var Documentation = {
168168
varterms=(params.highlight) ?params.highlight[0].split(/\s+/) :[];
169169
if(terms.length){
170170
varbody=$('div.body');
171+
if(!body.length){
172+
body=$('body');
173+
}
171174
window.setTimeout(function(){
172175
$.each(terms,function(){
173176
body.highlightText(this.toLowerCase(),'highlighted');

‎libs/network/doc/html/_static/epub.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- default theme.
66
*
7-
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

‎libs/network/doc/html/_static/pyramid.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- pylons theme.
66
*
7-
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

‎libs/network/doc/html/_static/searchtools.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx JavaScript utilties for the full-text search.
66
*
7-
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/
@@ -330,13 +330,13 @@ var Search = {
330330
objectterms.push(tmp[i].toLowerCase());
331331
}
332332

333-
if($u.indexOf(stopwords,tmp[i])!=-1||tmp[i].match(/^\d+$/)||
333+
if($u.indexOf(stopwords,tmp[i].toLowerCase())!=-1||tmp[i].match(/^\d+$/)||
334334
tmp[i]===""){
335335
// skip this "word"
336336
continue;
337337
}
338338
// stem the word
339-
varword=stemmer.stemWord(tmp[i]).toLowerCase();
339+
varword=stemmer.stemWord(tmp[i].toLowerCase());
340340
vartoAppend;
341341
// select the correct list
342342
if(word[0]=='-'){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp