We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm try to connect plaintext connection but the client auto redirect the ssl protocol which leading something wrong:
[2023-03-03T10:23:23Z ERROR pulsar::connection] connection error, not retryable: [Tls(Ssl(Error { code: ErrorCode(1), cause: Some(Ssl(ErrorStack([Error { code: 167772294, library: "SSL routines", function: "tls_post_process_server_certificate", reason: "certificate verify failed", file: "ssl/statem/statem_clnt.c", line: 1889 }]))) }, X509VerifyResult { code: 64, error: "IP address mismatch" }))]
use std::path; use apache_avro::Schema; use pulsar::{ message::proto, producer, Authentication, Error as PulsarError, Pulsar, SerializeMessage, TokioExecutor, }; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] struct Test { a: i64, b: String, } const raw_schema:&str = r#" { "type": "record", "name": "test", "fields": [ {"name": "a", "type": "long", "default": 42}, {"name": "b", "type": "string"} ] } "#; impl SerializeMessage for Test { fn serialize_message(input: Self) -> Result<producer::Message, PulsarError> { let schema = Schema::parse_str(raw_schema).unwrap(); let value = apache_avro::to_value(input).unwrap(); let value = value.resolve(&schema).unwrap(); let payload = apache_avro::to_avro_datum(&schema, value).unwrap(); // let payload = serde_json::to_vec(&input).map_err(|e| PulsarError::Custom(e.to_string()))?; Ok(producer::Message { payload, ..Default::default() }) } } #[tokio::main] async fn main() -> Result<(), pulsar::Error> { env_logger::init(); let addr = "pulsar://localhost:6650/"; let pulsar: Pulsar<_> = Pulsar::builder(addr, TokioExecutor) .with_auth(Authentication { name: "token".to_string(), data: "key".to_string().into_bytes(), }) .with_allow_insecure_connection(true) .with_certificate_chain_file(path::Path::new("./ca.cert.pem")).unwrap() .with_tls_hostname_verification_enabled(true) .build() .await?; let mut producer = pulsar .producer() .with_topic("persistent://test/test-ns/topic3") .with_name("my producer") .with_options(producer::ProducerOptions { schema: Some(proto::Schema { schema_data: raw_schema.as_bytes().into(), r#type: proto::schema::Type::Avro as i32, ..Default::default() }), ..Default::default() }) .build() .await?; let mut counter = 0usize; loop { producer .send(Test { a: 27, b: "foo".to_owned(), }) .await?; counter += 1; println!("{} messages", counter); tokio::time::sleep(std::time::Duration::from_millis(2000)).await; } }
The text was updated successfully, but these errors were encountered:
And disable hostname verification by .with_tls_hostname_verification_enabled(false),it still verify the ip name
.with_tls_hostname_verification_enabled(false)
Sorry, something went wrong.
No branches or pull requests
I'm try to connect plaintext connection but the client auto redirect the ssl protocol which leading something wrong:
The text was updated successfully, but these errors were encountered: