-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
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
[Bug]: Rest APIs not working with TLS enabled #36724
Comments
/assign @haorenfsa |
Hi @nish112022, thank you for the feedback. After tlsMode enabled, we should use the scheme curl --request POST --url "https://localhost:19530/v2/vectordb/collections/describe" --header "Authorization: Bearer 'root:milvus'" --header "accept:
application/json" --header "content-type: application/json" -d '{
"dbName": "default",
"collectionName": "hello_milvus"
}' |
MyBad @haorenfsa ,I should have explained a bit more.When I use the script you gave me , I get this error: When I give the cert as -cacert field I get this error:application/grpc expected not application json Below are the parameters I use for my hello_milvus.py.The same parameters should work here as well.
|
@nish112022 Oh, I get it. It seems to be the issue of golang's mux server when serving https & gRPC over TLS on the same port. For now you can walk around by configuring the http server to another port (for example, 8080) in milvus configuration: proxy:
http:
port: 8080 |
@nish112022 Yes, it's a bug in server side. by the way I just noticed that in the newest release, @chyezh has forbidden enable tls when enable restful & grpc in the same port. e34fa04#diff-6e86fc33d8695678bc197f60ce811f0a362cb3034cda0cc03823b5bc8822920eR75 I think we should fix this instead of forbidding the usage, in a way similar to this: https://ahmet.im/blog/grpc-http-mux-go/ |
@nish112022 For now only this works for me. We'll fix this later. Thank you again for feedback.
|
Yes, you are correct |
@haorenfsa So, I tried some approaches and there are essentially 2.
|
@nish112022 |
/assign @nish112022 |
Is there an existing issue for this?
Environment
Current Behavior
When I run this
It works, giving me the collection details.However, when I run the same command after enabling TLS mode=1 I get the error that application/grpc expected not application json
Link to thread:https://discord.com/channels/1160323594396635310/1293419285045182516
Expected Behavior
The command should work
curl --request POST --url "http://localhost:19531/v2/vectordb/collections/describe" --header "Authorization: Bearer 'admin:3kMjCMzfL25w'" --header "accept: application/json" --header "content-type: application/json" --cacert ./milvus-rest.cert -d '{ "dbName": "default", "collectionName": "hello_milvus" }'
Steps To Reproduce
Milvus Log
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: