[BUG] Search: Protocol validation prevents use with local emulator
See original GitHub issueLibrary name and version
Azure.Search.Documents
Describe the bug
On this line: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/src/SearchClient.cs#L196
Its throwing an error if the endpoint isn’t https
. I am using an emulator for local development and it is http
instead. This class shouldn’t attempt to validate the scheme, it’s not really its concern.
Expected behavior
I expect it to not throw an exception when provided an http
scheme endpoint url.
Actual behavior
It throws an ArgumentException
saying the scheme must be https
.
Reproduction Steps
new SearchClient("http://localhost:8080", "test", null);
Environment
> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.202
Commit: f8a55617d2
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.5
OS Platform: Darwin
RID: osx.12-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.202/
Host (useful for support):
Version: 6.0.4
Commit: be98e88c76
.NET SDKs installed:
5.0.400 [/usr/local/share/dotnet/sdk]
6.0.200 [/usr/local/share/dotnet/sdk]
6.0.201 [/usr/local/share/dotnet/sdk]
6.0.202 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
SDK v3 does not works locally with CosmosDB Emulator ...
I've tried to run the CosmosDb Emulator on a docker container without any success. By setting an IHttpClientFactory to bypass SSL certificate ...
Read more >Install and develop locally with Azure Cosmos DB Emulator
Learn how to install and use the Azure Cosmos DB Emulator on Windows, Linux, macOS, and Windows docker environments. Using the emulator you ......
Read more >Connect your app to the Authentication Emulator - Firebase
The Firebase Local Emulator Suite emulates products for a single Firebase project. To select the project to use, before you start the emulators,...
Read more >Testing apps locally with the emulator - Cloud Pub/Sub
To develop and test your application locally, you can use the Pub/Sub emulator, which provides local emulation of the production Pub/Sub service.
Read more >Reading bug reports
Android bug reports contain dumpsys , dumpstate , and logcat data in text (.txt) format, enabling you to easily search for specific content....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this issue as I believe it has been addressed. @justinmchase please feel free to reopen this issue or create a new one if you have any further questions. Thanks you!
By default, we do secure communication (https) over the wire. Even Search service doesn’t support http request and throws exception if we send http request:
<body>I believe If you’re using an emulator for local development, you can add HTTP support for our clients with a custom pipeline policy. Here’s how you can add:
In this sample,
https
endpoint will let it get past the validation in the constructor but the pipeline will flip it tohttp
before we send anything.