Networking 为什么是NSE';s网站不响应来自GCP VM的GET请求,但响应来自本地计算机的请求?

Networking 为什么是NSE';s网站不响应来自GCP VM的GET请求,但响应来自本地计算机的请求?,networking,https,google-cloud-platform,openssl,google-compute-engine,Networking,Https,Google Cloud Platform,Openssl,Google Compute Engine,我正在尝试使用Python获取NSE的网站,如下所示: from requests import Session headers = { "Host": "www1.nseindia.com", "Referer": "https://www1.nseindia.com/products/content/equities/equities/eq_security.htm", "X-Requested-With": "XMLHttpRequest"

我正在尝试使用Python获取NSE的网站,如下所示:

from requests import Session

headers = {
        "Host": "www1.nseindia.com",
        "Referer": "https://www1.nseindia.com/products/content/equities/equities/eq_security.htm",
        "X-Requested-With": "XMLHttpRequest",
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
        "Cache-Control": "no-cache",
        "Connection": "keep-alive",}

s = Session()
s.headers.update(headers)
url = "https://www.nseindia.com"
r = s.get(url)
print(r.text)
上面的代码在我的本地机器上运行,但在我从谷歌云实例运行时超时

这可能意味着NSE的网站正在阻止我的VM IP,为了隔离这个问题,我尝试使用OpenSSL命令行进行连接,该命令行再次在我的本地机器上工作,但在GCP VM上不工作。其他细节-从VM连接到NSE的服务器进行SSL握手,但之后没有响应-

$ openssl s_client -connect www.nseindia.com:443
CONNECTED(00000005)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
verify return:1
depth=0 C = IN, ST = Maharashtra, L = Mumbai, O = National Stock Exchange of India Ltd., OU = IT, CN = www.nseindia.com
verify return:1
---
Certificate chain
 0 s:C = IN, ST = Maharashtra, L = Mumbai, O = National Stock Exchange of India Ltd., OU = IT, CN = www.nseindia.com
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
 1 s:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
 2 s:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
CERTIFICATE REMOVED
-----END CERTIFICATE-----
subject=C = IN, ST = Maharashtra, L = Mumbai, O = National Stock Exchange of India Ltd., OU = IT, CN = www.nseindia.com

issuer=C = US, O = DigiCert Inc, OU = www.digicert.com, CN = GeoTrust RSA CA 2018

---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 6232 bytes and written 444 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: xxxxxxxxxxxxxxxxxxxxxxx
    Session-ID-ctx: 
    Master-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 7200 (seconds)
    TLS session ticket:
    0000 - 00 00 26 30 a1 f5 2f bf-a1 57 5e 66 57 e6 b6 f6   ..&0../..W^fW...
    ....
    ....
    00a0 - b6 84 52 56 e5 fb f1 4f-03 c5 8e 1a 04 c1 b8 6b   ..RV...O.......k

    Start Time: 1583754185
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no
---
GET / HTTP/1.1
Host: www.nseindia.com
accept-encoding: gzip, deflate, br
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-language: en-GB,en-US;q=0.9,en;q=0.8
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
cache-control: no-cache
pragma: no-cache
upgrade-insecure-requests: 1


请专家指导不响应的原因以及如何获得响应。

您可以尝试从GCP外部和GCP内部发出ping请求吗?是否解析到同一IP?