Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::http_t Namespace Reference

This module implements the functionalities of both server and client within a Trusted Execution Environment (TEE). More...

Classes

struct  ci
 Comparator for case-insensitive string comparison. More...
 
class  Client
 Client class for making HTTP and HTTPS requests. More...
 
class  Error
 Represents detailed error information, typically from client operations. More...
 
class  Filter
 Abstract base class for HTTP request filters. More...
 
class  FilterChain
 A class to manage a chain of filters for request processing. More...
 
class  Request
 HTTP request class to represent an incoming HTTP request. More...
 
class  Response
 HTTP response class to represent an outgoing HTTP response. More...
 
class  Result
 The result class of the client operation stores the response data of the request or the error information of the client operation. More...
 
class  Server
 HTTP service class for managing request listening and routing. More...
 

Typedefs

using TypeHeaders = std::map<std::string, std::string, ci>
 
using TypeParams = std::map<std::string, std::string>
 

Enumerations

enum class  ErrorCode {
  Success = 0 , InvalidParam = 1 , InvalidCall = 2 , InvalidUrl = 3 ,
  SetSeedFailed = 4 , ServerCAError = 5 , SSLConfigFailed = 6 , SSLSetupFailed = 7 ,
  SSLHostWrong = 8 , SSLHandShakeFailed = 9 , VerifyCertFailed = 10 , ConnectFailed = 11 ,
  WriteFailed = 12 , ReadFailed = 13 , MallocFailed = 14 , Unknown = 9999
}
 Error code of the client operation. More...
 
enum class  HttpStatusCode {
  Continue100 = 100 , SwitchingProtocol101 = 101 , Processing102 = 102 , EarlyHints103 = 103 ,
  OK200 = 200 , Created201 = 201 , Accepted202 = 202 , NonAuthoritativeInformation203 = 203 ,
  NoContent204 = 204 , ResetContent205 = 205 , PartialContent206 = 206 , MultiStatus207 = 207 ,
  AlreadyReported208 = 208 , IMUsed226 = 226 , MultipleChoices300 = 300 , MovedPermanently301 = 301 ,
  Found302 = 302 , SeeOther303 = 303 , NotModified304 = 304 , UseProxy305 = 305 ,
  Unused306 = 306 , TemporaryRedirect307 = 307 , PermanentRedirect308 = 308 , BadRequest400 = 400 ,
  Unauthorized401 = 401 , PaymentRequired402 = 402 , Forbidden403 = 403 , NotFound404 = 404 ,
  MethodNotAllowed405 = 405 , NotAcceptable406 = 406 , ProxyAuthenticationRequired407 = 407 , RequestTimeout408 = 408 ,
  Conflict409 = 409 , Gone410 = 410 , LengthRequired411 = 411 , PreconditionFailed412 = 412 ,
  PayloadTooLarge413 = 413 , UriTooLong414 = 414 , UnsupportedMediaType415 = 415 , RangeNotSatisfiable416 = 416 ,
  ExpectationFailed417 = 417 , ImATeapot418 = 418 , MisdirectedRequest421 = 421 , UnprocessableContent422 = 422 ,
  Locked423 = 423 , FailedDependency424 = 424 , TooEarly425 = 425 , UpgradeRequired426 = 426 ,
  PreconditionRequired428 = 428 , TooManyRequests429 = 429 , RequestHeaderFieldsTooLarge431 = 431 , UnavailableForLegalReasons451 = 451 ,
  InternalServerError500 = 500 , NotImplemented501 = 501 , BadGateway502 = 502 , ServiceUnavailable503 = 503 ,
  GatewayTimeout504 = 504 , HttpVersionNotSupported505 = 505 , VariantAlsoNegotiates506 = 506 , InsufficientStorage507 = 507 ,
  LoopDetected508 = 508 , NotExtended510 = 510 , NetworkAuthenticationRequired511 = 511
}
 

Variables

constexpr int SSGX_HTTP_CLIENT_TIMEOUT = 5
 

Detailed Description

This module implements the functionalities of both server and client within a Trusted Execution Environment (TEE).

Typedef Documentation

◆ TypeHeaders

using ssgx::http_t::TypeHeaders = std::map<std::string, std::string, ci>

◆ TypeParams

using ssgx::http_t::TypeParams = std::map<std::string, std::string>

Enumeration Type Documentation

◆ ErrorCode

enum class ssgx::http_t::ErrorCode
strong

Error code of the client operation.

Enumerator
Success 

OK

InvalidParam 

Invalid parameters, maybe some parameters are nullptr.

InvalidCall 

Invalid calling stack.

InvalidUrl 

The specified url is invalid.

SetSeedFailed 

Failed to set seed for random number.

ServerCAError 

Failed to parse ca certificate chain string.

SSLConfigFailed 

Failed to configure connection setting.

SSLSetupFailed 

Failed to set up ssl.

SSLHostWrong 

Failed to set host name.

SSLHandShakeFailed 

Failed to handshake with the server.

VerifyCertFailed 

Failed to verify server's certificates chain.

ConnectFailed 

Failed to connect to host.

WriteFailed 

Failed to send data to tje server.

ReadFailed 

Failed to read data from the server.

MallocFailed 

Failed to malloc memory.

Unknown 

Unknown error occurred.

◆ HttpStatusCode

enum class ssgx::http_t::HttpStatusCode
strong
Enumerator
Continue100 

100: Continue with request

SwitchingProtocol101 

101: Switching Protocols

Processing102 

102: Processing request

EarlyHints103 

103: Early hints for request

OK200 

200: Request was successful

Created201 

201: Resource was created

Accepted202 

202: Request has been accepted

NonAuthoritativeInformation203 

203: Non-authoritative information

NoContent204 

204: No content in the response

ResetContent205 

205: Reset content

PartialContent206 

206: Partial content

MultiStatus207 

207: Multi-status response

AlreadyReported208 

208: Already reported

IMUsed226 

226: IM used

MultipleChoices300 

300: Multiple choices available

MovedPermanently301 

301: Moved permanently

Found302 

302: Found

SeeOther303 

303: See other location

NotModified304 

304: Not modified

UseProxy305 

305: Use proxy

Unused306 

306: Reserved (no longer in use)

TemporaryRedirect307 

307: Temporary redirect

PermanentRedirect308 

308: Permanent redirect

BadRequest400 

400: Bad request

Unauthorized401 

401: Unauthorized

PaymentRequired402 

402: Payment required

Forbidden403 

403: Forbidden

NotFound404 

404: Not found

MethodNotAllowed405 

405: Method not allowed

NotAcceptable406 

406: Not acceptable

ProxyAuthenticationRequired407 

407: Proxy authentication required

RequestTimeout408 

408: Request timeout

Conflict409 

409: Conflict

Gone410 

410: Gone

LengthRequired411 

411: Length required

PreconditionFailed412 

412: Precondition failed

PayloadTooLarge413 

413: Payload too large

UriTooLong414 

414: URI too long

UnsupportedMediaType415 

415: Unsupported media type

RangeNotSatisfiable416 

416: Range not satisfiable

ExpectationFailed417 

417: Expectation failed

ImATeapot418 

418: I'm a teapot (a joke error code)

MisdirectedRequest421 

421: Misdirected request

UnprocessableContent422 

422: Unprocessable content

Locked423 

423: Locked

FailedDependency424 

424: Failed dependency

TooEarly425 

425: Too early

UpgradeRequired426 

426: Upgrade required

PreconditionRequired428 

428: Precondition required

TooManyRequests429 

429: Too many requests

RequestHeaderFieldsTooLarge431 

431: Request header fields too large

UnavailableForLegalReasons451 

451: Unavailable for legal reasons

InternalServerError500 

500: Internal server error

NotImplemented501 

501: Not implemented

BadGateway502 

502: Bad gateway

ServiceUnavailable503 

503: Service unavailable

GatewayTimeout504 

504: Gateway timeout

HttpVersionNotSupported505 

505: HTTP version not supported

VariantAlsoNegotiates506 

506: Variant also negotiates

InsufficientStorage507 

507: Insufficient storage

LoopDetected508 

508: Loop detected

NotExtended510 

510: Not extended

NetworkAuthenticationRequired511 

511: Network authentication required

Variable Documentation

◆ SSGX_HTTP_CLIENT_TIMEOUT

int ssgx::http_t::SSGX_HTTP_CLIENT_TIMEOUT = 5
constexpr