mirror of
https://github.com/mimblewimble/grin-wallet.git
synced 2025-01-20 19:11:09 +03:00
add server auth argument to http client
This commit is contained in:
parent
21dd3d5377
commit
f52a8d2c7c
1 changed files with 18 additions and 4 deletions
|
@ -165,11 +165,25 @@ impl WalletCommAdapter for HTTPWalletCommAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn post<IN>(url: &str, api_secret: Option<String>, input: &IN) -> Result<String, api::Error>
|
||||
pub fn post<IN>(
|
||||
url: &str,
|
||||
server_auth: &ServerAuth,
|
||||
api_secret: Option<String>,
|
||||
input: &IN,
|
||||
) -> Result<String, api::Error>
|
||||
where
|
||||
IN: Serialize,
|
||||
{
|
||||
let req = api::client::create_post_request(url, api_secret, input)?;
|
||||
let res = api::client::send_request(req)?;
|
||||
Ok(res)
|
||||
// need to configure https client to use a custom TlsServerVerifier that checks to server pk
|
||||
// against ServerAuth
|
||||
unimplemented!()
|
||||
// let req = api::client::create_post_request(url, api_secret, input)?;
|
||||
// let res = api::client::send_request(req)?;
|
||||
// Ok(res)
|
||||
}
|
||||
|
||||
/// Setting to enable or disable server authentication using the servers know public key.
|
||||
enum ServerAuth {
|
||||
AllowUnauthenticated,
|
||||
AllowPublicKey([u8; 32]),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue