GithubHelp home page GithubHelp logo

Comments (6)

clue avatar clue commented on August 29, 2024

Thanks for the elaborate error report! 👍

It looks like this is not an issue in this library but actually how PHP tries to establish a secure TLS connection to this endpoint. This can easily be verified like this:

>>> $f = stream_socket_client('tls://connect-bot.classic.blizzard.com:443');
PHP warning:  stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed on line 1

Does anybody happen to have any thoughts?

from pawl.

user4B1D avatar user4B1D commented on August 29, 2024

So i've been trying to do some sleuthing around, found out that openssl s_client -connect connect-bot.classic.blizzard.com:443
returns an error code: Verify return code: 21 (unable to verify the first certificate)

I contacted my webhosting provider (a2hosting.com) and they were kind enough to also help.

You may want to pass SSL Context Options on to your app developer... This can be found at the following URL:
http://php.net/manual/en/context.ssl.php

From my understanding having a chain like this we need the valid first level hostname cert name "*.blizzard.com"?

I am going to bed now though, i'll take a look at it after work tomorrow and see if I can commit something. (feel free to yourself though)

p.s.
Here is the official documentation on the API: https://d8un0y0mnd29o.cloudfront.net/public/Chat+Bot+API+Alpha+v2.pdf

It is recommended that the certificate is checked to ensure that the common name matches *.classic.blizzard.com

from pawl.

user4B1D avatar user4B1D commented on August 29, 2024

quick update: adding the context option for cafile got me to another error, but im making progress.

the ca file needed is: DigiCertSHA2HighAssuranceServerCA.crt for this particular server

next error is

Could not connect: HTTP/1.1 101 Switching Protocols Upgrade: WebSocket Connection: Upgrade Sec-WebSocket-Protocol: json Sec-WebSocket-Accept: (mumbo jumbo here)

from pawl.

user4B1D avatar user4B1D commented on August 29, 2024

edit: fixed

problem: user error

from pawl.

clue avatar clue commented on August 29, 2024

Happy to see you've managed to solve this! In case anybody runs into similar problems, may I ask you for a short gist of the fixed code? 👍

from pawl.

user4B1D avatar user4B1D commented on August 29, 2024

I had missed the fact that the constructor for the connector paeses security options (SSL context options) so I added those and got past the cert failure with an included cafile. After that it told me the handshake failed. As per the rfc this was correct so I added the sub protocol option as json and it's working now.

from pawl.

Related Issues (20)

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.