Skip to content

Enhance Rust Proxy to Extract TLS Server Details and Interface with Cairo #5

@neotheprogramist

Description

@neotheprogramist

Project

Enhancing User Experience in Web3 Dapps with Social Authentications

Problem

In our current implementation, we need to create a Rust proxy that can interface with our Cairo code. This proxy should leverage rustls to extract details from the TLS handshake, specifically the server's public key, certificate, and the connected domain. The goal is to pass this data to our Cairo program to validate the server's certificate.

Requirements

  1. Proxy Enhancement: Based on the existing code, develop the proxy to extract the required TLS handshake details.

  2. TLS Handshake: Implement a step-by-step TLS handshake using rustls. The implementation should be clear and document each step to provide insights into the TLS handshake process.

  3. Data Interchange with Cairo: Since Cairo does not directly accept string inputs/hints, we need an efficient mechanism to work with domain strings. For a start, encoding them as ASCII and passing them as felt arrays might be suitable.

  4. Workflow:

    • Accept a domain as input from the Cairo program: request_input.json
    • Make a request to the given domain using the proxy.
    • The proxy should extract the necessary keys and certificate, required for Cairo validation.

Concerns

The main challenge lies in the restrictions Cairo imposes on input data types. Finding a developer-friendly mechanism to communicate with Cairo is crucial. Moreover, the clarity of the TLS handshake process is vital for understanding and potential modifications in the future.

Action Items

  • Update the Rust proxy to work with rustls and extract TLS details.
  • Implement a clear step-by-step TLS handshake in Rust.
  • Develop a method to pass domain strings and other data to Cairo.
  • Test the workflow using a few different domains and validate certificate details in Cairo.

Note: Careful attention is required to ensure data integrity, especially while interfacing between the Rust proxy and Cairo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions