-
Notifications
You must be signed in to change notification settings - Fork 425
[RestEndpointOption][IPV4 instead of Domain] Set RestEndpointOption with ip address resolved by dns 8.8.8.8, result in "The specified bucket does not exist." #15019
-
Set RestEndpointOption with ipv4 address resolved by dns 8.8.8.8, and the https request failed with "The specified bucket does not exist.". Can RestEndpointOption set to ip address resolved by dns ? Is the domain "storage.googleapis.com" the only option for RestEndpointOption ? Could you help me with this @dbolduc, I'll be extremely grateful!
Beta Was this translation helpful? Give feedback.
All reactions
@ddelgrosso1 Finally I figure out that the problem is caused by SNI field in TLS message,if I set CURLIOT_URL with IPV4,SNI is empty which lead to a "NoSuchBucket" respond. Set the CURLOPT_CURL with "https://storage.googleapis.com:443" and CURLOPT_RESOLVE with "storage.googleapis.com:443:142.251.32.123" (142.251.32.123 is the result of dns resolve), curl will send TLS message to endporint 142.251.32.123 with SNI. I Customized CURLOPT_RESOLVE parameters in sdk and it works! Thanks for the help!
Replies: 2 comments 5 replies
-
Hey, I am no longer working on this project. So I will tag: @scotthart
Beta Was this translation helpful? Give feedback.
All reactions
-
@FengYikai710 Yes, RestEndpointOption should work with an IP address. For example:
auto client = google::cloud::storage::Client(
google::cloud::Options{}
.set<google::cloud::storage::RestEndpointOption>("127.0.0.1:9000"));
auto ws = client.WriteObject("ddelgrosso-test-bucket", "test-cancellation");
Resulted in requests being sent to a listening emulator running on 127.0.0.1 port 9000.
Beta Was this translation helpful? Give feedback.
All reactions
-
@FengYikai710 do you have a code sample and / or can you explain a bit about what you are trying to accomplish. It would help me guide you a bit better.
Beta Was this translation helpful? Give feedback.
All reactions
-
@ddelgrosso1 code sample as follows:
auto client = google::cloud::storage::Client( google::cloud::Options{} .set<google::cloud::storage::RestEndpointOption>("https://74.125.68.207:443"));
auto response = client.ListBucketsForProject("test_project");
I tried to access storge service with ipv4 address, and the sdk return StatusCode kNotFound with msg
image
Beta Was this translation helpful? Give feedback.
All reactions
-
@FengYikai710 from the error it isn't clear that there is a problem connecting to the IP address provided. Rather it looks like the service is returning a not found. Can you try running with logging enabled by setting the environment variables: CLOUD_STORAGE_ENABLE_TRACING=rpc,http GOOGLE_CLOUD_CPP_ENABLE_CLOG=Y. This might help give a better idea of what is going on.
Beta Was this translation helpful? Give feedback.
All reactions
-
@ddelgrosso1 Finally I figure out that the problem is caused by SNI field in TLS message,if I set CURLIOT_URL with IPV4,SNI is empty which lead to a "NoSuchBucket" respond. Set the CURLOPT_CURL with "https://storage.googleapis.com:443" and CURLOPT_RESOLVE with "storage.googleapis.com:443:142.251.32.123" (142.251.32.123 is the result of dns resolve), curl will send TLS message to endporint 142.251.32.123 with SNI. I Customized CURLOPT_RESOLVE parameters in sdk and it works! Thanks for the help!
Beta Was this translation helpful? Give feedback.