Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Victoriabank test payment gateway has incomplete SSL certificate chain and breaks onboarding tests #14

Closed
alexminza opened this issue Nov 20, 2019 · 3 comments

Comments

@alexminza
Copy link
Contributor

https://www.ssllabs.com/ssltest/analyze.html?d=ecomt.victoriabank.md&latest

Screenshot 2019-11-20 at 11 48 26

Screenshot 2019-11-20 at 11 48 34

Compare to the production gateway configuration: https://www.ssllabs.com/ssltest/analyze.html?d=egateway.victoriabank.md&latest

Screenshot 2019-11-20 at 11 52 11

The problem arises only for the Complete/Reverse payments steps because they use the PHP file_get_contents function to perform the web request, while the Authorize functionality is performed by the user browser, which will fallback and complete the certificate chain in such cases.

A way to disable SSL verification for test gateway only is needed to allow new users to perform the onboarding technical tests and promote their project into production payment gateway.

This could be achieved by conditionally (only in DEBUG/TEST modes) adding the following parameters on the request() function stream context options for the CompletionRequest and ReversalRequest classes:

'ssl' => [
    "verify_peer" => false,
    "verify_peer_name" => false,
]
@alexminza
Copy link
Contributor Author

One possibility would be to use the existing Request->_debugMode parameter:

if($this->_debugMode) {
    #Disable gateway SSL certificate verification in DEBUG mode
    $options['ssl'] = [
        "verify_peer" => false,
        "verify_peer_name" => false,
    ];
}

Reference: https://github.com/Fruitware/VictoriaBankGateway/blob/master/src/VictoriaBank/Completion/CompletionRequest.php#L107

@alexminza
Copy link
Contributor Author

Or introduce an additional setting similar to Request->_debugMode:
Request->_sslVerify

alexminza added a commit to alexminza/VictoriaBankGateway that referenced this issue Nov 20, 2019
Solution for Fruitware#14
@alexminza
Copy link
Contributor Author

Addressed by pull request #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant