# 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 (QObject)
  reference to the parent object

#### EricSslErrorHandler.__certToString

__certToString(cert)

Private method to convert a certificate to a formatted string.

cert (QSslCertificate)
  certificate to convert

Return:
  formatted string

Return Type:
  str

#### EricSslErrorHandler.__getSystemCaCertificates

__getSystemCaCertificates()

Private method to get the list of system certificates.

Return:
  list of system certificates

Return Type:
  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 (QNetworkReply)
  reference to the reply object
errors (list of QSslError)
  list of SSL errors

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

Return Type:
  tuple of (EricSslErrorState, bool)

#### EricSslErrorHandler.sslErrorsReplySlot

sslErrorsReplySlot(reply, errors)

Public slot to handle SSL errors for a network reply.

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

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