erovira / transa-script

Shell script to compute the Itaú/BROU mean USD/UYU exchange rate
6 stars 2 forks source link

Script fails on Monterey fresh install #1

Closed erovira closed 2 years ago

erovira commented 2 years ago

Curl appears not to be fetching the exchange rate properly on a Monterey fresh install.

➜  ~ transa 200
(standard_in) 1: parse error
Itaú compra y venta: ,
( + ) / 2 =
(standard_in) 1: parse error
TRANSA: U$S 200 = $

Curl version:

➜  ~ curl --version
curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
Release-Date: 2021-05-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets

When running just the initial curl, without the silent we get the following:

➜  ~ curl https://www.itau.com.uy/inst/aci/cotiz.xml
curl: (35) error:06FFF089:digital envelope routines:CRYPTO_internal:bad key length
erovira commented 2 years ago

Workaround: Use the latest curl (currently 7.80.0): You can install it with Homebew; brew install curl

➜  ~ transa 200
Itaú compra y venta: 43.25, 45.05
(43.25 + 45.05) / 2 = 44.15
TRANSA: U$S 200 = $ 8830.00
➜  ~ curl --version
curl 7.80.0 (x86_64-apple-darwin21.1.0) libcurl/7.80.0 (SecureTransport) OpenSSL/1.1.1l zlib/1.2.11 brotli/1.0.9 zstd/1.5.0 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.46.0 librtmp/2.3 OpenLDAP/2.6.0
Release-Date: 2021-11-10
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets zstd