File indexing completed on 2023-10-01 04:06:23
0001 /* 0002 This file is part of the KDE project 0003 SPDX-FileCopyrightText: 2009 Andreas Hartmetz <ahartmetz@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef _KSSLUI_H 0009 #define _KSSLUI_H 0010 0011 #include "kiowidgets_export.h" 0012 #include <ksslerroruidata.h> 0013 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 64) 0014 #include <ktcpsocket.h> 0015 #endif 0016 0017 namespace KIO 0018 { 0019 /** UI methods for handling SSL errors. */ 0020 namespace SslUi 0021 { 0022 /** Error rule storage behavior. */ 0023 enum RulesStorage { 0024 RecallRules = 1, ///< apply stored certificate rules (typically ignored errors) 0025 StoreRules = 2, ///< make new ignore rules from the user's choice and store them 0026 RecallAndStoreRules = 3, ///< apply stored rules and store new rules 0027 }; 0028 0029 #if KIOWIDGETS_ENABLE_DEPRECATED_SINCE(5, 64) 0030 /** 0031 * @deprecated since 5.64 use the KSslErrorUiData variant instead. 0032 */ 0033 KIOWIDGETS_EXPORT 0034 KIOWIDGETS_DEPRECATED_VERSION(5, 64, "Use KIO::SslUi::askIgnoreSslErrors(const KSslErrorUiData &, RulesStorage)") 0035 bool askIgnoreSslErrors(const KTcpSocket *socket, RulesStorage storedRules = RecallAndStoreRules); 0036 #endif 0037 0038 /** 0039 * If there are errors while establishing an SSL encrypted connection to a peer, usually due to 0040 * certificate issues, and since this poses a security issue, we need confirmation from the user about 0041 * how they wish to proceed. 0042 * 0043 * This function provides a dialog asking the user if they wish to abort the connection or ignore 0044 * the SSL errors that occurred and continue connecting. And in case of the latter whether to remember 0045 * the decision in the future or ignore the error temporarily. 0046 * 0047 * @p uiData the KSslErrorUiData object constructed from the socket that is trying to establish the 0048 * encrypted connection 0049 * @p storedRules see RulesStorage Enum 0050 */ 0051 bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KSslErrorUiData &uiData, RulesStorage storedRules = RecallAndStoreRules); 0052 } 0053 } 0054 0055 #endif