# eric7.EricNetwork.EricSslErrorHandler

Module implementing a SSL error handler.

### Global Attributes

None

### Classes

EricSslErrorHandler | Class implementing a handler for SSL errors.
EricSslErrorState | Class defining the SSL error handling states.

### Functions

None

## EricSslErrorHandler

Class implementing a handler for SSL errors.

It also initializes the default SSL configuration with certificates permanently accepted by the user already.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

EricSslErrorHandler | Constructor
__certToString | Private method to convert a certificate to a formatted string.
__getSystemCaCertificates | Private method to get the list of system certificates.
sslErrors | Public method to handle SSL errors.
sslErrorsReply | Public slot to handle SSL errors for a network reply.
sslErrorsReplySlot | Public slot to handle SSL errors for a network reply.

### Static Methods

None

#### EricSslErrorHandler (Constructor)

EricSslErrorHandler(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### EricSslErrorHandler.__certToString

__certToString(cert)

Private method to convert a certificate to a formatted string.

cert
  certificate to convert (QSslCertificate)

Return:
  formatted string (string)

#### EricSslErrorHandler.__getSystemCaCertificates

__getSystemCaCertificates()

Private method to get the list of system certificates.

Return:
  list of system certificates (list of QSslCertificate)

#### EricSslErrorHandler.sslErrors

sslErrors(errors, server, port=-1)

Public method to handle SSL errors.

errors (list of QSslError)
  list of SSL errors
server (str)
  name of the server
port (int)
  value of the port

Return:
  tuple indicating to ignore the SSL errors and indicating a change of the default SSL configuration

Return Type:
  tuple of (EricSslErrorState, bool)

#### EricSslErrorHandler.sslErrorsReply

sslErrorsReply(reply, errors)

Public slot to handle SSL errors for a network reply.

reply
  reference to the reply object (QNetworkReply)
errors
  list of SSL errors (list of QSslError)

Return:
  tuple indicating to ignore the SSL errors (one of NotIgnored, SystemIgnored or UserIgnored) and indicating a change of the default SSL configuration (boolean)

#### EricSslErrorHandler.sslErrorsReplySlot

sslErrorsReplySlot(reply, errors)

Public slot to handle SSL errors for a network reply.

reply
  reference to the reply object (QNetworkReply)
errors
  list of SSL errors (list of QSslError)

Up

## EricSslErrorState

Class defining the SSL error handling states.

### Derived from

enum.Enum

### Class Attributes

NOT_IGNORED
SYSTEM_IGNORED
USER_IGNORED

### Class Methods

None

### Methods

None

### Static Methods

None

Up