File indexing completed on 2024-12-01 06:45:40

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 
0014 namespace KIO
0015 {
0016 /** UI methods for handling SSL errors. */
0017 namespace SslUi
0018 {
0019 /** Error rule storage behavior. */
0020 enum RulesStorage {
0021     RecallRules = 1, ///< apply stored certificate rules (typically ignored errors)
0022     StoreRules = 2, ///< make new ignore rules from the user's choice and store them
0023     RecallAndStoreRules = 3, ///< apply stored rules and store new rules
0024 };
0025 
0026 /**
0027  * If there are errors while establishing an SSL encrypted connection to a peer, usually due to
0028  * certificate issues, and since this poses a security issue, we need confirmation from the user about
0029  * how they wish to proceed.
0030  *
0031  * This function provides a dialog asking the user if they wish to abort the connection or ignore
0032  * the SSL errors that occurred and continue connecting. And in case of the latter whether to remember
0033  * the decision in the future or ignore the error temporarily.
0034  *
0035  * @p uiData the KSslErrorUiData object constructed from the socket that is trying to establish the
0036  *           encrypted connection
0037  * @p storedRules see RulesStorage Enum
0038  */
0039 bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KSslErrorUiData &uiData, RulesStorage storedRules = RecallAndStoreRules);
0040 }
0041 }
0042 
0043 #endif