Ошибка grpc клиент
Ошибка: Received http2 header with status: 400
NGINX default.conf
server {
listen 443 ssl http2;
server_name users.captain-cake.ru;
ssl_certificate /etc/letsencrypt/live/users.captain-cake.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/users.captain-cake.ru/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_client_certificate /etc/letsencrypt/live/users.captain-cake.ru/cert.pem;
ssl_verify_client on;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization, x-grpc-web, x-user-agent' always;
add_header 'Access-Control-Expose-Headers' 'grpc-status, grpc-message' always;
location /users. {
grpc_set_header Content-Type application/grpc;
grpc_set_header X-Forwarded-For $remote_addr;
grpc_pass grpc://user:50051;
}
}
Клиент
async with grpc.aio.secure_channel('users.captain-cake.ru', grpc.ssl_channel_credentials()) as channel:
stub = users_pb2_grpc.UsersStub(channel)
request = users_pb2.UsersRequest(offset=0, limit=0)
response = stub.GetUsers(
request,
metadata=(
('access-token', 'access token'),
('api-key', 'api key'),
)
)
async for user in response:
print(user.id)