- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 istio ingress 网关中试验 ssl 连接。
从这里istio ssl gateway without termination ,我假设默认情况下 istio 入口网关应该终止 ssl。
我已经通过 istioctl 安装了带有演示配置文件的 istio。我也安装了我的服务svc1
.
除此之外,以下是我的路由逻辑资源:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: vs-gateway
namespace: myns
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 443
name: https
protocol: HTTPS
tls:
mode: SIMPLE
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt
privateKey: /etc/istio/ingressgateway-certs/tls.key
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: vs
namespace: myns
spec:
hosts:
- "*"
gateways:
- vs-gateway
http:
- match:
- uri:
prefix: "/svc1/"
rewrite:
uri: "/"
route:
- destination:
host: svc1
port:
number: 80
我通过 this 找到了网关 url .对于实验,我还启用了 http
在入口网关上。那样curl http://172.17.0.2:<http_node_port>
适用于 200 个响应。后来我删除了http
来自入口网关并仅保留 https(因为 https 是我的主要目标是通过入口网关接收)
然后尝试在网关 url 上使用 https 进行 curl。我得到 503。
$ curl -ivk https://172.17.0.2:<https_node_port>/svc1/user
* Trying 172.17.0.2...
* TCP_NODELAY set
* Connected to 172.17.0.2 (172.17.0.2) port 30278 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Client hello (1):
* TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=CA; O=Abc; CN=example.com
* start date: Dec 31 08:22:32 2019 GMT
* expire date: Jan 30 08:22:32 2020 GMT
* issuer: C=US; ST=CA; O=Abc; CN=example.com
* SSL certificate verify result: self signed certificate (18), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* Using Stream ID: 1 (easy handle 0x55c961626580)
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
> GET /svc1/user HTTP/2
> Host: 172.17.0.2:30278
> User-Agent: curl/7.58.0
> Accept: */*
>
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
< HTTP/2 503
HTTP/2 503
< content-length: 95
content-length: 95
< content-type: text/plain
content-type: text/plain
< date: Thu, 02 Jan 2020 08:13:49 GMT
date: Thu, 02 Jan 2020 08:13:49 GMT
< server: istio-envoy
server: istio-envoy
<
* Connection #0 to host 172.17.0.2 left intact
upstream connect error or disconnect/reset before headers. reset reason: connection termination
我还在 svc pod sidecar 上启用了 sidecar istio proxy debuggin。我得到了以下日志
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [external/envoy/source/extensions/filters/listener/original_dst/original_dst.cc:18] original_dst: New connection accepted
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [external/envoy/source/extensions/filters/listener/tls_inspector/tls_inspector.cc:72] tls inspector: new connection accepted
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:30] Called tcp filter: Filter
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:40] Called tcp filter: initializeReadFilterCallbacks
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [external/envoy/source/common/tcp_proxy/tcp_proxy.cc:204] [C88] new tcp proxy session
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:133] [C88] Called tcp filter onNewConnection: remote 10.244.0.5:34148, local 10.244.0.16:3000
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][filter] [external/envoy/source/common/tcp_proxy/tcp_proxy.cc:347] [C88] Creating connection to cluster inbound|80|serviceport|svc1.myns.svc.cluster.local
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:83] creating a new connection
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:364] [C89] connecting
[Envoy (Epoch 0)] [2020-01-02 06:53:19.392][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:711] [C89] connecting to 127.0.0.1:3000
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:720] [C89] connection in progress
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:109] queueing request due to no available connections
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][conn_handler] [external/envoy/source/server/connection_handler_impl.cc:333] [C88] new connection
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:559] [C89] connected
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:285] [C89] assigning connection
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][filter] [external/envoy/source/common/tcp_proxy/tcp_proxy.cc:541] TCP:onUpstreamEvent(), requestedServerName:
[Envoy (Epoch 0)] [2020-01-02 06:53:19.393][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:143] Called tcp filter completeCheck: OK
[Envoy (Epoch 0)] [2020-01-02 06:53:19.395][28][debug][filter] [src/istio/control/client_context_base.cc:139] Report attributes: attributes {
key: "connection.event"
value {
string_value: "open"
}
}
attributes {
key: "connection.id"
value {
string_value: "38a9b348-1730-4e0b-9664-fbbaeedd9215-88"
}
[Envoy (Epoch 0)] [2020-01-02 06:53:19.395][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:100] [C88] Called tcp filter onRead bytes: 664
[Envoy (Epoch 0)] [2020-01-02 06:53:19.396][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:123] [C88] Called tcp filter onWrite bytes: 28
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:123] [C88] Called tcp filter onWrite bytes: 0
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:100] [C88] Called tcp filter onRead bytes: 34
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:527] [C88] remote close
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:193] [C88] closing socket: 0
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:174] [C88] Called tcp filter onEvent: 0 upstream 127.0.0.1:3000
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][filter] [src/istio/control/client_context_base.cc:139] Report attributes: attributes {
key: "connection.duration"
value {
duration_value {
nanos: 6151000
}
}
}
attributes {
key: "connection.event"
value {
string_value: "close"
}
}
at
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:104] [C89] closing data_to_write=34 type=0
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][conn_handler] [external/envoy/source/server/connection_handler_impl.cc:88] [C88] adding to cleanup list
[Envoy (Epoch 0)] [2020-01-02 06:53:19.398][28][debug][filter] [src/envoy/tcp/mixer/filter.cc:35] Called tcp filter : ~Filter
[Envoy (Epoch 0)] [2020-01-02 06:53:19.399][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:589] [C89] write flush complete
[Envoy (Epoch 0)] [2020-01-02 06:53:19.399][28][debug][connection] [external/envoy/source/common/network/connection_impl.cc:193] [C89] closing socket: 1
[Envoy (Epoch 0)] [2020-01-02 06:53:19.399][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:124] [C89] client disconnected
[Envoy (Epoch 0)] [2020-01-02 06:53:19.399][28][debug][pool] [external/envoy/source/common/tcp/conn_pool.cc:238] [C89] connection destroyed
根据日志,入口网关似乎正在将 ssl 请求转发到 svc。 (如有错误请指正)
所以最后,谁能帮我在入口网关处终止 ssl,并将纯 http 请求转发给 svc?
最佳答案
基于此github issue还有这个istio documentation
Named service ports: Service ports must be named. The port name key/value pairs must have the following syntax: name: [-]. See Protocol Selection for more details.
ports:
- name: serviceport
我建议将其更改为提到的 http/https there并由在 github 上遇到同样问题的社区成员确认.
手动协议(protocol)选择
Protocols can be specified manually by naming the Service port name: [-]. The following protocols are supported:
*These protocols are disabled by default to avoid accidentally enabling experimental features. To enable them, configure the corresponding Pilot environment variables.
关于ssl - 如何在 istio 的入口网关终止 ssl?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59560394/
据我了解,无论如何,您的 Istio 网关前都会有一个 NLB 或 ALB? 但我很困惑,因为 Istio Gateway 似乎为 ALB 为第 7 层甚至更多做了很多事情? 所以我读了 ALB ->
只是一般的好奇,我还没有找到任何关于它的信息。 我最近开始学习微服务及其相关内容,例如 API 网关。我知道 API 网关可以是 Web 应用程序等的单一入口点。但是,如果有多个服务,每个服务都有自己
我对网关和虚拟机的设置有多个疑问,所以这就是我的实际情况。 我有一个应用程序网关和两个 VM Ubuntu,所有内容都托管在 Azure 上。它们都位于同一个虚拟网络上。两个虚拟机都只有一个私有(pr
在 spring-boot-integration 应用程序中,编写了一个自定义储物柜,在锁定之前重命名原始文件 (fileToLock.getAbsolutePath() + ".lock") 并预
网卡eth0 IP修改为 102.168.0.1 复制代码 代码如下: ifconfig eth0 102.168.0.1 netma
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章Linux系统下修改IP地址、网关、DNS的基本方法由作者收集整理,如果
我正在考虑改变我的背部将 rest api 微服务结束到 grpc 服务器。我使用 tyk 作为 api 网关来路由 http 请求。 api 网关如何处理 grpc 请求? 最佳答案 使用 gRPC
我在 AWS ApiGateway 上配置/使用身份验证时遇到了一些问题。我已经使用接收 AWS 身份验证模型的代码设置了我的 lambda 函数,见下文,它基本上解码 JWT token 并验证给定
虚拟网络网关与 VPN 网关之间有哪些区别?是什么决定了使用哪一个? 我能找到的最接近的定义是 “VPN 网关是一种特定类型的虚拟网络网关,用于通过公共(public) Internet 在 Azur
我有一个调用 _getFile 函数的输入字段 获取文件 _getFile(event) { this.loading = true; const file = event.target.f
对于微服务,常用的设计模式是 API-Gateway。我对它的实现和影响有点困惑。我的问题/疑虑如下: 为什么一般不讨论微服务的其他模式?如果是,那么我错过了他们吗? 如果我们部署一个网关服务器,那不
我们正在尝试将我们的单体核心拆分为微服务,并添加一些使用消息系统(例如 Kafka)相互连接的新服务。 下一阶段是创建 API 端点,以便通过 Api 网关在移动应用程序和微服务之间进行通信。 开发
我在本地网关上创建连接时遇到问题。 当我创建连接时,Vnet 网关是可选的,但当我选择它时,Azure 未填充或实际选择网关,不确定原因。我是否需要任何下标,或者我的 vnet 网关创建不正确? 最佳
我正在用 Java 开发 Web 服务。现在假设我有 10 项服务,并且我希望只能通过 Apigateway 访问我的所有服务。 现在假设我有一个 API 调用,需要调用 4 个服务,例如 A、B、C
我正在做一个学校项目,我的任务是制作一个简单的 api 网关,它可以放置在任何第 3 方 api 和最终用户之间,该网关可用于定义 api 的使用限制或做一些安全分析,我对此完全陌生,我知道API网关
我正在尝试集成 AWS Api Gateway 和 AWS Lambda, 我能够调用 Lambda 函数并获得响应。 但是当我使用 AWS API Gateway 并使用 GET 方法调用我的 La
我对 Spring 和 Activiti 都是个菜鸟,所以这应该是一个很大的问题。如果我的问题结构不佳或其他什么问题,我提前道歉。 这是我的 Activity 图的一部分: 首先要做的事情: 在服务任
我正在尝试将 API 网关与 Lambda 代理集成, API 服务器接收带有这些参数的请求,即邮政编码和房屋 https://api.domain.com/getAddressproxy?postc
在我们的案例中,我们需要用户在注册期间或进行任何业务交易之前预先批准他们的付款。 一旦授权,我们需要每月从他们的账户中扣除 $X。X 将根据他们当月的收入而有所不同。此外,对于某些用户,我们需要每月支
我正在尝试使用 ActiveMerchant 创建一个 Paypal express 交易。有没有办法将收款人设置为负责支付任何应计费用的实体? payment_hash = { ip: ip
我是一名优秀的程序员,十分优秀!