Code Monkey home page Code Monkey logo

Comments (4)

OtavioHenrique avatar OtavioHenrique commented on August 10, 2024

Hi @dukex, currently we're using default Whatsapp certificate

from whatsapp.

dukex avatar dukex commented on August 10, 2024

@OtavioHenrique nice, how are you make the setup to works with the gem, I need send the cainfo options to Typhoeus, like it:

      response = Typhoeus.post(
        full_path,
        headers: {
          "Authorization" => "#{token_name} #{token}",
          "Content-Type" => "application/json"
        },
        body: payload && payload.to_json,
        cainfo: '/certs/external-ca.perm'
      )

There is a better way to handle with it?

from whatsapp.

OtavioHenrique avatar OtavioHenrique commented on August 10, 2024

@dukex Sorry but we don't have support to certificates yet, we're only making login as described on our doc.

What are you doing? Do you need any help/feature?

from whatsapp.

dukex avatar dukex commented on August 10, 2024

It's just to know how others company are handle with the Whats App self-signed certificate.

To be documented, the best way to handle is documented here https://curl.haxx.se/docs/sslcerts.html.

My main problem in development was the CAfile was set up automatically to /etc/ssl/certs/ca-certificates.crt, running curl https://localhost:9090/v1 -v

% curl https://localhost:9090/v1 -v                                                                                                                                                                
*   Trying ::1:9090...   
* TCP_NODELAY set                                                                                                                                                                                                    
* Connected to localhost (::1) port 9090 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1                    
* successfully set certificate verify locations:                                                          
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none                                  
* TLSv1.3 (OUT), TLS handshake, Client hello (1):                                                                                                                                                                    
* TLSv1.3 (IN), TLS handshake, Server hello (2):                                                          
* TLSv1.2 (IN), TLS handshake, Certificate (11): 
* TLSv1.2 (OUT), TLS alert, unknown CA (560):   
* SSL certificate problem: self signed certificate in certificate chain
* Closing connection 0                                                                                    
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html                                                
                                                                                                          
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.      

To fix, I retrieve the WhatsApp certificate, you can use -k in curl to make a insecure request, and append into /etc/ssl/certs/ca-certificates.crt

echo external-ca.pem | sudo tee /etc/ssl/certs/ca-certificates.crt  

from whatsapp.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.