|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | | -import os.path |
4 | | - |
5 | 3 | from sopel.config.types import ( |
6 | 4 | BooleanAttribute, |
7 | 5 | ChoiceAttribute, |
|
23 | 21 | """Default URL schemes allowed for URLs.""" |
24 | 22 |
|
25 | 23 |
|
26 | | -def _find_certs(): |
27 | | - """Find the TLS root CA store. |
28 | | -
|
29 | | - :returns: path to CA store file |
30 | | - :rtype: str |
31 | | - """ |
32 | | - # check if the root CA store is at a known location |
33 | | - locations = [ |
34 | | - '/etc/pki/tls/cert.pem', # best first guess |
35 | | - '/etc/ssl/certs/ca-certificates.crt', # Debian |
36 | | - '/etc/ssl/cert.pem', # FreeBSD base OpenSSL |
37 | | - '/usr/local/openssl/cert.pem', # FreeBSD userland OpenSSL |
38 | | - '/etc/pki/tls/certs/ca-bundle.crt', # RHEL 6 / Fedora |
39 | | - '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem', # RHEL 7 / CentOS |
40 | | - '/etc/pki/tls/cacert.pem', # OpenELEC |
41 | | - '/etc/ssl/ca-bundle.pem', # OpenSUSE |
42 | | - ] |
43 | | - for certs in locations: |
44 | | - if os.path.isfile(certs): |
45 | | - return certs |
46 | | - return None |
47 | | - |
48 | | - |
49 | 24 | def configure(config): |
50 | 25 | """Interactively configure the bot's ``[core]`` config section. |
51 | 26 |
|
@@ -228,17 +203,16 @@ class CoreSection(StaticSection): |
228 | 203 |
|
229 | 204 | """ |
230 | 205 |
|
231 | | - ca_certs = FilenameAttribute('ca_certs', default=_find_certs()) |
232 | | - """The path to the CA certs ``.pem`` file. |
| 206 | + ca_certs = FilenameAttribute('ca_certs') |
| 207 | + """The path to the CA certs ``PEM`` file. |
233 | 208 |
|
234 | 209 | Example: |
235 | 210 |
|
236 | 211 | .. code-block:: ini |
237 | 212 |
|
238 | 213 | ca_certs = /etc/ssl/certs/ca-certificates.crt |
239 | 214 |
|
240 | | - If not specified, Sopel will try to find the certificate trust store |
241 | | - itself from a set of known locations. |
| 215 | + If not specified, the system default will be used. |
242 | 216 |
|
243 | 217 | If the given value is not an absolute path, it will be interpreted relative |
244 | 218 | to the directory containing the config file with which Sopel was started. |
|
0 commit comments