| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b0e2e8a commit fd8ea5b
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -474,6 +474,7 @@ Additional information for v31.2 release: | |||
| 474 | 474 | * [GetVersion](api/cefpython.md#getversion) | |
| 475 | 475 | * [Initialize](api/cefpython.md#initialize) | |
| 476 | 476 | * [IsThread](api/cefpython.md#isthread) | |
| 477 | + * [LoadCrlSetsFile](api/cefpython.md#loadcrlsetsfile) | ||
| 477 | 478 | * [MessageLoop](api/cefpython.md#messageloop) | |
| 478 | 479 | * [MessageLoopWork](api/cefpython.md#messageloopwork) | |
| 479 | 480 | * [PostTask](api/cefpython.md#posttask) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,6 +162,7 @@ | |||
| 162 | 162 | * [GetVersion](cefpython.md#getversion) | |
| 163 | 163 | * [Initialize](cefpython.md#initialize) | |
| 164 | 164 | * [IsThread](cefpython.md#isthread) | |
| 165 | + * [LoadCrlSetsFile](cefpython.md#loadcrlsetsfile) | ||
| 165 | 166 | * [MessageLoop](cefpython.md#messageloop) | |
| 166 | 167 | * [MessageLoopWork](cefpython.md#messageloopwork) | |
| 167 | 168 | * [PostTask](cefpython.md#posttask) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,7 @@ Table of contents: | |||
| 21 | 21 | * [GetVersion](#getversion) | |
| 22 | 22 | * [Initialize](#initialize) | |
| 23 | 23 | * [IsThread](#isthread) | |
| 24 | + * [LoadCrlSetsFile](#loadcrlsetsfile) | ||
| 24 | 25 | * [MessageLoop](#messageloop) | |
| 25 | 26 | * [MessageLoopWork](#messageloopwork) | |
| 26 | 27 | * [PostTask](#posttask) | |
@@ -200,6 +201,22 @@ CEF maintains multiple internal threads that are used for handling different typ | |||
| 200 | 201 | See PostTask() for a list of threads. | |
| 201 | 202 | ||
| 202 | 203 | ||
| 204 | + ### LoadCrlSetsFile | ||
| 205 | + | ||
| 206 | + | Parameter | Type | | ||
| 207 | + | --- | --- | | ||
| 208 | + | path | bytes | | ||
| 209 | + | __Return__ | bool | | ||
| 210 | + | ||
| 211 | + Description from upstream CEF: | ||
| 212 | + > Loads the existing "Certificate Revocation Lists" file that is managed by | ||
| 213 | + > Google Chrome. This file can generally be found in Chrome's User Data | ||
| 214 | + > directory (e.g. "C:\Users\[User]\AppData\Local\Google\Chrome\User Data\" on | ||
| 215 | + > Windows) and is updated periodically by Chrome's component updater service. | ||
| 216 | + > Must be called in the browser process after the context has been initialized. | ||
| 217 | + > See https://dev.chromium.org/Home/chromium-security/crlsets for background. | ||
| 218 | + | ||
| 219 | + | ||
| 203 | 220 | ### MessageLoop | |
| 204 | 221 | ||
| 205 | 222 | | | | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,7 +134,7 @@ cef_extension_handler.h | |||
| 134 | 134 | - CefExtensionHandler | |
| 135 | 135 | ||
| 136 | 136 | cef_file_util.h | |
| 137 | - - CefLoadCRLSetsFile | ||
| 137 | + + CefLoadCRLSetsFile | ||
| 138 | 138 | ||
| 139 | 139 | cef_request_handler.h | |
| 140 | 140 | - CanGetCookies | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -300,6 +300,7 @@ from main_message_loop cimport * | |||
| 300 | 300 | # noinspection PyUnresolvedReferences | |
| 301 | 301 | from cef_views cimport * | |
| 302 | 302 | from cef_log cimport * | |
| 303 | + from cef_file_util cimport * | ||
| 303 | 304 | ||
| 304 | 305 | # ----------------------------------------------------------------------------- | |
| 305 | 306 | # GLOBAL VARIABLES | |
@@ -1019,3 +1020,6 @@ cpdef dict GetVersion(): | |||
| 1019 | 1020 | cef_commit_hash=__cef_commit_hash__, | |
| 1020 | 1021 | cef_commit_number=__cef_commit_number__, | |
| 1021 | 1022 | ) | |
| 1023 | + | ||
| 1024 | + cpdef LoadCrlSetsFile(py_string path): | ||
| 1025 | + CefLoadCRLSetsFile(PyToCefStringValue(path)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + # Copyright (c) 2018 CEF Python, see the Authors file. | ||
| 2 | + # All rights reserved. Licensed under BSD 3-clause license. | ||
| 3 | + # Project website: https://github.com/cztomczak/cefpython | ||
| 4 | + | ||
| 5 | + from cef_string cimport CefString | ||
| 6 | + | ||
| 7 | + cdef extern from "include/cef_file_util.h": | ||
| 8 | + void CefLoadCRLSetsFile(const CefString& path) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,6 +3,7 @@ | |||
| 3 | 3 | # Project website: https://github.com/cztomczak/cefpython | |
| 4 | 4 | ||
| 5 | 5 | include "cefpython.pyx" | |
| 6 | + include "string_utils.pyx" | ||
| 6 | 7 | ||
| 7 | 8 | # noinspection PyUnresolvedReferences | |
| 8 | 9 | cimport cef_types | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,6 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | 12 | from cefpython3 import cefpython as cef | |
| 13 | 13 | ||
| 14 | + import glob | ||
| 14 | 15 | import os | |
| 15 | 16 | import sys | |
| 16 | 17 | ||
@@ -126,15 +127,39 @@ def test_main(self): | |||
| 126 | 127 | # Test initialization of CEF | |
| 127 | 128 | settings = { | |
| 128 | 129 | "debug": False, | |
| 129 | - "log_severity": cef.LOGSEVERITY_ERROR, | ||
| 130 | + "log_severity": cef.LOGSEVERITY_WARNING, | ||
| 130 | 131 | "log_file": "", | |
| 131 | 132 | } | |
| 132 | 133 | if "--debug" in sys.argv: | |
| 133 | 134 | settings["debug"] = True | |
| 134 | 135 | settings["log_severity"] = cef.LOGSEVERITY_INFO | |
| 136 | + if "--debug-warning" in sys.argv: | ||
| 137 | + settings["debug"] = True | ||
| 138 | + settings["log_severity"] = cef.LOGSEVERITY_WARNING | ||
| 135 | 139 | cef.Initialize(settings) | |
| 136 | 140 | subtest_message("cef.Initialize() ok") | |
| 137 | 141 | ||
| 142 | + # CRL set file | ||
| 143 | + certrevoc_dir = "" | ||
| 144 | + if WINDOWS: | ||
| 145 | + certrevoc_dir = r"C:\localappdata\Google\Chrome\User Data" \ | ||
| 146 | + r"\CertificateRevocation" | ||
| 147 | + elif LINUX: | ||
| 148 | + certrevoc_dir = r"/home/*/.config/google-chrome" \ | ||
| 149 | + r"/CertificateRevocation" | ||
| 150 | + elif MAC: | ||
| 151 | + certrevoc_dir = r"/Users/*/Library/Application Support/Google" \ | ||
| 152 | + r"/Chrome/CertificateRevocation" | ||
| 153 | + if os.path.exists(certrevoc_dir): | ||
| 154 | + crlset_files = glob.iglob(os.path.join(certrevoc_dir, "*", | ||
| 155 | + "crl-set")) | ||
| 156 | + crlset = "" | ||
| 157 | + for crlset in crlset_files: | ||
| 158 | + pass | ||
| 159 | + if os.path.exists(crlset): | ||
| 160 | + cef.LoadCrlSetsFile(crlset) | ||
| 161 | + subtest_message("cef.LoadCrlSetsFile ok") | ||
| 162 | + | ||
| 138 | 163 | # High DPI on Windows | |
| 139 | 164 | if WINDOWS: | |
| 140 | 165 | self.assertIsInstance(cef.DpiAware.GetSystemDpi(), tuple) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments