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 | /*! |
17 | * \namespace KIO::SslUi |
18 | * \inheaderfile KIO/SslUi |
19 | * \inmodule KIOWidgets |
20 | * \brief UI methods for handling SSL errors. |
21 | */ |
22 | namespace SslUi |
23 | { |
24 | /*! |
25 | * Error rule storage behavior |
26 | * |
27 | * \value RecallRules Apply stored certificate rules (typically ignored errors) |
28 | * \value StoreRules Make new ignore rules from the user's choice and store them |
29 | * \value RecallAndStoreRules Apply stored rules and store new rules |
30 | */ |
31 | enum RulesStorage { |
32 | RecallRules = 1, |
33 | StoreRules = 2, |
34 | RecallAndStoreRules = 3, |
35 | }; |
36 | |
37 | /*! |
38 | * If there are errors while establishing an SSL encrypted connection to a peer, usually due to |
39 | * certificate issues, and since this poses a security issue, we need confirmation from the user about |
40 | * how they wish to proceed. |
41 | * |
42 | * This function provides a dialog asking the user if they wish to abort the connection or ignore |
43 | * the SSL errors that occurred and continue connecting. And in case of the latter whether to remember |
44 | * the decision in the future or ignore the error temporarily. |
45 | * |
46 | * \a uiData the KSslErrorUiData object constructed from the socket that is trying to establish the |
47 | * encrypted connection |
48 | * |
49 | * \a storedRules see RulesStorage Enum |
50 | */ |
51 | bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KSslErrorUiData &uiData, RulesStorage storedRules = RecallAndStoreRules); |
52 | } |
53 | } |
54 | |
55 | #endif |
56 | |