Skip to content

Commit

Permalink
Correct front page example and clean up SSL text.
Browse files Browse the repository at this point in the history
The fourth argument to NetworkInsightClient() is verify_cert, not timeout. In the example, pass timeout as a kwarg instead of positional.
  • Loading branch information
fotonick committed Aug 20, 2023
1 parent 5d59535 commit e2eacea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ to a client class. For example:
timeout = 5
netinsight_client = diagnostics.NetworkInsightClient(
api_key, api_secret, opnsense_url, timeout)
api_key, api_secret, opnsense_url, timeout=timeout)
print(netinsight_client.get_interfaces())
Expand Down
18 changes: 9 additions & 9 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ API Reference
=============

This document attempts to document the API provided by the pyopnsense library.
It is a combination of autogenerated api documentation and usage explanations.
It is a combination of autogenerated API documentation and usage explanations.

Instantiating Clients
---------------------
Expand All @@ -21,18 +21,18 @@ SSL Certificate Verification
''''''''''''''''''''''''''''

By default the SSL certificate verification is disabled. This is to enable a
working client out of the box. (since by default OPNsense is it's own CA, so
it likely won't be in your system's CA bundle) The tradeoff here is obviously
working client out of the box, since by default OPNsense is its own CA, so
it likely won't be in your system's CA bundle. The tradeoff here is obviously
security. It's **strongly** recommended that you enable SSL verification once
you start using the client for anything beyond basic testing. To do this the
``verify`` kwarg is used. This value gets passed directly to `requests`_ verify
kwarg on the HTTP methods. You can set this to either ``True`` which will
enable it and use your default system installed CA bundles, or the path to a CA
certificate or bundle directory. More details can be found in the requests
documentation here:
http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
``verify_cert`` kwarg is used. This value gets passed directly to `requests`_
``verify`` kwarg on the HTTP methods. You can set this to either ``True`` which
will enable it and use your default system installed CA bundles, or the path to
a CA certificate or bundle directory. More details can be found in the `requests
documentation`_.

.. _requests: http://docs.python-requests.org/en/master/
.. _requests documentation: http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification

Client Classes
==============
Expand Down

0 comments on commit e2eacea

Please sign in to comment.