Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify notary url parsing to make it generic for both ip and domain #366

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions notary-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ docker run --init -p 127.0.0.1:7047:7047 ghcr.io/tlsnotary/tlsn/notary-server:la
```bash
docker run --init -p 127.0.0.1:7047:7047 -v <your config folder path>:/root/.notary-server/config ghcr.io/tlsnotary/tlsn/notary-server:latest
```
P/S: When running this notary-server image against a [prover](https://github.com/tlsnotary/tlsn/tree/3e0dcc77d5b8b7d6739ca725f36345108ebecd75/tlsn/examples), please ensure that the prover's tagged version is the same as the version tag of this image.

#### Building from source
1. Configure the server setting in this config [file](./config/config.yaml).
Expand Down
18 changes: 4 additions & 14 deletions tlsn/examples/discord/discord_dm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ use futures::AsyncWriteExt;
use hyper::{body::to_bytes, client::conn::Parts, Body, Request, StatusCode};
use rustls::{Certificate, ClientConfig, RootCertStore};
use serde::{Deserialize, Serialize};
use std::{
env,
fs::File as StdFile,
io::BufReader,
net::{IpAddr, SocketAddr},
ops::Range,
sync::Arc,
};
use std::{env, fs::File as StdFile, io::BufReader, ops::Range, sync::Arc};
use tlsn_core::proof::TlsProof;
use tokio::{fs::File, io::AsyncWriteExt as _, net::TcpStream};
use tokio_rustls::TlsConnector;
Expand Down Expand Up @@ -221,12 +214,9 @@ async fn setup_notary_connection() -> (tokio_rustls::client::TlsStream<TcpStream
.with_no_client_auth();
let notary_connector = TlsConnector::from(Arc::new(client_notary_config));

let notary_socket = tokio::net::TcpStream::connect(SocketAddr::new(
IpAddr::V4(NOTARY_HOST.parse().unwrap()),
NOTARY_PORT,
))
.await
.unwrap();
let notary_socket = tokio::net::TcpStream::connect((NOTARY_HOST, NOTARY_PORT))
.await
.unwrap();

let notary_tls_socket = notary_connector
// Require the domain name of notary server to be the same as that in the server cert
Expand Down
18 changes: 4 additions & 14 deletions tlsn/examples/twitter/twitter_dm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ use futures::AsyncWriteExt;
use hyper::{body::to_bytes, client::conn::Parts, Body, Request, StatusCode};
use rustls::{Certificate, ClientConfig, RootCertStore};
use serde::{Deserialize, Serialize};
use std::{
env,
fs::File as StdFile,
io::BufReader,
net::{IpAddr, SocketAddr},
ops::Range,
sync::Arc,
};
use std::{env, fs::File as StdFile, io::BufReader, ops::Range, sync::Arc};
use tokio::{fs::File, io::AsyncWriteExt as _, net::TcpStream};
use tokio_rustls::TlsConnector;
use tokio_util::compat::{FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt};
Expand Down Expand Up @@ -210,12 +203,9 @@ async fn setup_notary_connection() -> (tokio_rustls::client::TlsStream<TcpStream
.with_no_client_auth();
let notary_connector = TlsConnector::from(Arc::new(client_notary_config));

let notary_socket = tokio::net::TcpStream::connect(SocketAddr::new(
IpAddr::V4(NOTARY_HOST.parse().unwrap()),
NOTARY_PORT,
))
.await
.unwrap();
let notary_socket = tokio::net::TcpStream::connect((NOTARY_HOST, NOTARY_PORT))
.await
.unwrap();

let notary_tls_socket = notary_connector
// Require the domain name of notary server to be the same as that in the server cert
Expand Down