1 | /* |
2 | This file is part of the KDE project |
3 | SPDX-FileCopyrightText: 2009 Andreas Hartmetz <ahartmetz@gmail.com> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef _KSSLUI_H |
9 | #define _KSSLUI_H |
10 | |
11 | #include "kiowidgets_export.h" |
12 | #include <ksslerroruidata.h> |
13 | |
14 | namespace KIO |
15 | { |
16 | /** UI methods for handling SSL errors. */ |
17 | namespace SslUi |
18 | { |
19 | /** Error rule storage behavior. */ |
20 | enum RulesStorage { |
21 | RecallRules = 1, ///< apply stored certificate rules (typically ignored errors) |
22 | StoreRules = 2, ///< make new ignore rules from the user's choice and store them |
23 | RecallAndStoreRules = 3, ///< apply stored rules and store new rules |
24 | }; |
25 | |
26 | /** |
27 | * If there are errors while establishing an SSL encrypted connection to a peer, usually due to |
28 | * certificate issues, and since this poses a security issue, we need confirmation from the user about |
29 | * how they wish to proceed. |
30 | * |
31 | * This function provides a dialog asking the user if they wish to abort the connection or ignore |
32 | * the SSL errors that occurred and continue connecting. And in case of the latter whether to remember |
33 | * the decision in the future or ignore the error temporarily. |
34 | * |
35 | * @p uiData the KSslErrorUiData object constructed from the socket that is trying to establish the |
36 | * encrypted connection |
37 | * @p storedRules see RulesStorage Enum |
38 | */ |
39 | bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KSslErrorUiData &uiData, RulesStorage storedRules = RecallAndStoreRules); |
40 | } |
41 | } |
42 | |
43 | #endif |
44 | |