Forums

Error SSL connection

I request file to server, about 2 weeks ago it work fine but now it has error 403.

I try on my Macbook Sonoma 14.2.1, it still work ok.

Please help me fix this bug

Below is log from curl:

(web101) 15:10 ~/web101 (master)$ * Connected to rr2---sn-5go7yner.googlevideo.com (74.125.110.167) port 443 (#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
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [6 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [4741 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [264 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=*.c.docs.google.com
*  start date: Feb 13 14:31:21 2024 GMT
*  expire date: Apr 23 14:31:20 2024 GMT
*  subjectAltName: host "rr2---sn-5go7yner.googlevideo.com" matched cert's "*.googlevideo.com"
*  issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1C3
*  SSL certificate verify ok.
} [5 bytes data]
> GET /videoplayback?expire=1708202279 HTTP/1.1
> Host: rr2---sn-5go7yner.googlevideo.com
> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
> Connection: keep-alive
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> Accept-Language: en-us,en;q=0.5
> Sec-Fetch-Mode: navigate
> Accept-Encoding: identity
> Range: bytes=0-10477437
> 
{ [5 bytes data]
* Mark bundle as not supporting multiuse
< HTTP/1.1 403 Forbidden
< Last-Modified: Wed, 02 May 2007 10:26:10 GMT
< Content-Type: text/plain
< Content-Length: 0
< Connection: close
< Vary: Origin
< Cross-Origin-Resource-Policy: cross-origin
< X-Content-Type-Options: nosniff
< Date: Sat, 17 Feb 2024 15:10:46 GMT
< Server: gvs 1.0
< 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
} [5 bytes data]
* TLSv1.3 (OUT), TLS alert, close notify (256):
} [2 bytes data]

What is the command you run?

i use youtube-dl to get link of video youtube

youtube-dl --get-url -f 22 https://www.youtube.com/watch\?v\=tnACDTqaRYk

then use curl to get content of file from output of first command

curl -v -O link_from_output_command_above

Could you show the error itself? I don't see it in the output.

Can you login to my account

open terminal, then do steps:

cd ~/web101/
workon web101
yt-dlp --get-url -f 22 https://www.youtube.com/watch\?v\=tnACDTqaRYk
curl -v -O link_from_output_command_above

the last command curl -v ... will print debug info with ALPN, server did not agree to a protocol and error HTTP/1.1 403 Forbidden

I try on my Macbook Sonoma 14.2.1, it work fine with code 200.

What is the URL that you are trying to access?

Hi, because this is url from youtube, it will expire after few hours, so, can you follow steps in my previous post to get actual link.

Please help me solve this problem.

We are not going to poke around in your account to run your code.

Youtube are quite strict about blocking scripted access to youtube and probably have a block against the whole of AWS to prevent it.

yep, thanks your advise.