Skip to content

Commit

Permalink
add Network Socket related TLS error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK committed Sep 3, 2024
1 parent cad8639 commit e0a5f59
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/aws/io/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,21 @@ enum aws_io_errors {

AWS_ERROR_PEM_MALFORMED,

AWS_IO_TLS_UNKNOWN_ROOT_CERTIFICATE,
AWS_IO_TLS_NO_ROOT_CERTIFICATE_FOUND,
AWS_IO_TLS_CERTIFICATE_EXPIRED,
AWS_IO_TLS_CERTIFICATE_NOT_YET_VALID,
AWS_IO_TLS_BAD_CERTIFICATE,
AWS_IO_TLS_PEER_CERTIFICATE_EXPIRED,
AWS_IO_TLS_BAD_PEER_CERTIFICATE,
AWS_IO_TLS_PEER_CERTIFICATE_REVOKED,
AWS_IO_TLS_PEER_CERTIFICATE_UNKNOWN,
AWS_IO_TLS_INTERNAL_ERROR,
AWS_IO_TLS_CLOSED_GRACEFUL,
AWS_IO_TLS_CLOSED_ABORT,
AWS_IO_TLS_INVALID_CERTIFICATE_CHAIN,
AWS_IO_TLS_HOST_NAME_MISSMATCH,

AWS_IO_ERROR_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_IO_PACKAGE_ID),
AWS_IO_INVALID_FILE_HANDLE = AWS_ERROR_INVALID_FILE_HANDLE,
};
Expand Down
44 changes: 44 additions & 0 deletions source/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,50 @@ static struct aws_error_info s_errors[] = {
"Failure during TLS read."),
AWS_DEFINE_ERROR_INFO_IO(AWS_ERROR_PEM_MALFORMED, "Malformed PEM object encountered."),

AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_UNKNOWN_ROOT_CERTIFICATE,
"Channel shutdown due to tls unknown root certificate."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_NO_ROOT_CERTIFICATE_FOUND,
"Channel shutdown due to tls no root certificate found."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_CERTIFICATE_EXPIRED,
"Channel shutdown due to tls certificate expired."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_CERTIFICATE_NOT_YET_VALID,
"Channel shutdown due to tls certificate not yet valid."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_BAD_CERTIFICATE,
"Channel shutdown due to tls certificate is malformed or not correctly formatted."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_PEER_CERTIFICATE_EXPIRED,
"Channel shutdown due to peer tls certificate is malformed or not correctly formatted."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_BAD_PEER_CERTIFICATE,
"Channel shutdown due to peer tls certificate is malformed or not correctly formatted."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_PEER_CERTIFICATE_REVOKED,
"Channel shutdown due to peer tls certificate has been revoked."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_PEER_CERTIFICATE_UNKNOWN,
"Channel shutdown due to peer tls certificate is unknown."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_INTERNAL_ERROR,
"Channel shutdown due to internal SSL error."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_CLOSED_GRACEFUL,
"Channel shutdown due to connection closed gracefully."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_CLOSED_ABORT,
"Channel shutdown due to connection closed due to an error."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_INVALID_CERTIFICATE_CHAIN,
"Channel shutdown due to invalid certificate chain."),
AWS_DEFINE_ERROR_INFO_IO(
AWS_IO_TLS_HOST_NAME_MISSMATCH,
"Channel shutdown due to certificate's host name does not match the endpoint host name."),


};
/* clang-format on */

Expand Down

0 comments on commit e0a5f59

Please sign in to comment.