Skip to content
This repository has been archived by the owner on Nov 28, 2020. It is now read-only.

ZAP auth sometimes not retried using TCP #30

Open
jean-airoldie opened this issue May 22, 2019 · 2 comments
Open

ZAP auth sometimes not retried using TCP #30

jean-airoldie opened this issue May 22, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@jean-airoldie
Copy link
Owner

Filed this issue in libzmq.

@jean-airoldie jean-airoldie added the bug Something isn't working label May 22, 2019
@jean-airoldie
Copy link
Owner Author

jean-airoldie commented May 23, 2019

When using CURVE, the authentication is simply not retried.

Minimal reproduction example:

use libzmq::{prelude::*, auth::*, *};
use std::{time::Duration, convert::TryInto};

#[test]
fn test_issue_30() {
    let ctx = Ctx::new();

    let server_cert = CurveCert::new_unique();
    let client_cert = CurveCert::new_unique();

    let addr: TcpAddr = "127.0.0.1:*".try_into().unwrap();

    let server_creds = CurveServerCreds {
        secret: server_cert.secret().to_owned(),
    };

    let client_creds = CurveClientCreds {
        client: client_cert,
        server: server_cert.public().to_owned(),
    };

    let server = ServerBuilder::new()
        .bind(&addr)
        .mechanism(server_creds)
        .recv_timeout(Duration::from_millis(200))
        .with_ctx(&ctx)
        .unwrap();

    let bound = server.last_endpoint().unwrap().unwrap();

    let client = ClientBuilder::new()
        .mechanism(&client_creds)
        .connect(bound)
        .with_ctx(&ctx)
        .unwrap();

    client.send("").unwrap();
    assert!(server.recv_msg().is_err());

    let channel = AuthClient::with_ctx(&ctx).unwrap();
    channel.add_curve_key(client_creds.client.public()).unwrap();

    server.recv_msg().unwrap();
}

@jean-airoldie
Copy link
Owner Author

This is most likely related to #44.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant