Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

fix: SSL error when using the client with the emulator - #297

Merged
plamut merged 2 commits into
googleapis:masterfrom
plamut:iss-290
Mar 2, 2021
Merged

fix: SSL error when using the client with the emulator#297
plamut merged 2 commits into
googleapis:masterfrom
plamut:iss-290

Conversation

@plamut

@plamutplamut commented Feb 24, 2021

Copy link
Copy Markdown
Contributor

Fixes#290.

This PR makes sure that insecure gRPC channel is used when running against the emulator. To verify the fix, run the code example as described in the issue description.

The PR also includes a lot of unrelated synth changes in the second commit, but that's because #258 and #267 could not be merged yet, the CLA status is stuck. If this PR is merged, we could even close the other two.

PR checklist:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@plamut
plamut requested a review from a team as a code ownerFebruary 24, 2021 20:50
@google-clagoogle-claBot added the cla: yes This human has signed the Contributor License Agreement. label Feb 24, 2021
@product-auto-labelproduct-auto-labelBot added the api: pubsub Issues related to the googleapis/python-pubsub API. label Feb 24, 2021
@plamutplamut changed the title Fix SSL error when using the client with the emulatorfix: SSL error when using the client with the emulatorFeb 24, 2021
@anguillanneuf
anguillanneuf self-requested a review February 26, 2021 19:39

@anguillanneufanguillanneuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what's wrong, but when trying your code against the emulator, I still got errors:

E0226 11:38:32.777295000 4749241856 ssl_transport_security.cc:1439] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0226 11:38:33.843773000 4749241856 ssl_transport_security.cc:1439] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0226 11:38:35.286951000 4749241856 ssl_transport_security.cc:1439] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.
E0226 11:38:38.925703000 4749241856 ssl_transport_security.cc:1439] Handshake failed with fatal error SSL_ERROR_SSL: error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER.

And the emulator complains about:

[pubsub] INFO: Unknown request URI: /bad-request
[pubsub] Feb 26, 2021 11:39:01 AM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
[pubsub] INFO: Detected non-HTTP/2 connection.
[pubsub] Feb 26, 2021 11:39:01 AM io.gapi.emulators.netty.NotFoundHandler handleRequest
[pubsub] INFO: Unknown request URI: /bad-request

My gcloud SDK version is 329.0.0.

@plamut

Copy link
Copy Markdown
ContributorAuthor

@anguillanneuf Strange, I cannot reproduce this, it works just fine (both with gcloud SDK 327.0.0 and yours 329.0.0).

Can you double check that it's indeed the code from the PR branch that is run and that PUBSUB_EMULATOR_HOST env variable is set? Did you use the exact same script as in the ticket description, or perhaps a different one?

I'm trying to figure out if and where our test setups differ....

@anguillanneuf
anguillanneuf self-requested a review March 1, 2021 19:01

@anguillanneufanguillanneuf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plamut Ah I'm so sorry. I created a branch of the name plamut-iss-290 but I never pulled in your code. Your fix is working for me.

@plamut
plamut merged commit 83db672 into googleapis:masterMar 2, 2021
@plamut
plamut deleted the iss-290 branch March 2, 2021 13:02
globophobe added a commit to globophobe/cryptofeed that referenced this pull request Mar 10, 2021
Fixed breaking changes introduced by gcloud-aio dependency.
Note: Pinned google_cloud_pubsub~=2.2.0 in setup.py because of an SSL issue in the Pub/Sumb emulator.
google_cloud_pubsub fix is merged, but not on pypi: googleapis/python-pubsub#297
globophobe added a commit to globophobe/cryptofeed that referenced this pull request Mar 10, 2021
Fixed breaking changes introduced by gcloud-aio dependency.
Closesbmoscon#433
Note: Pinned google_cloud_pubsub~=2.2.0 in setup.py because of an SSL issue in the Pub/Sumb emulator.
google_cloud_pubsub fix is merged, but not on pypi: googleapis/python-pubsub#297
globophobe added a commit to globophobe/cryptofeed that referenced this pull request Mar 10, 2021
Fixed breaking changes introduced by gcloud-aio dependency.
Closesbmoscon#433
Note: Pinned google_cloud_pubsub~=2.2.0 in setup.py because of an SSL issue in the Pub/Sumb emulator.
google_cloud_pubsub fix is merged, but not on pypi: googleapis/python-pubsub#297
bmoscon pushed a commit to bmoscon/cryptofeed that referenced this pull request Mar 10, 2021
Fixed breaking changes introduced by gcloud-aio dependency.
Closes#433
Note: Pinned google_cloud_pubsub~=2.2.0 in setup.py because of an SSL issue in the Pub/Sumb emulator.
google_cloud_pubsub fix is merged, but not on pypi: googleapis/python-pubsub#297
@release-pleaserelease-pleaseBot mentioned this pull request Aug 11, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: pubsubIssues related to the googleapis/python-pubsub API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2.3.0 breaks local testing with the pubsub-emulator

2 participants

@plamut@anguillanneuf