开发者

how can I redirect to https which require certain sertificate for access

开发者 https://www.devze.com 2023-01-30 06:10 出处:网络
There\'s a payment server. I can successfully send data via cURL and set appropriate key and certificate and 开发者_如何学Cpayment server successfully answers. But now I need to make a redirect to tha

There's a payment server. I can successfully send data via cURL and set appropriate key and certificate and 开发者_如何学Cpayment server successfully answers. But now I need to make a redirect to that server so that client can enter credit card data. How can I make that redirect?

Is there a possibility to add key/certificate as a part of headers in function header("Location: https://...."); ?


Even if you could send the certificate along with the redirect, the browser still has to verify it. But you can't. It's impossible. You have to send a regular redirect. Because it's a https address, the browser will first request the certificate from the target host and verify it (including necessary user intervention). The outcome is the same.

There is no way to circumvent the popup dialog requesting the user to accept/trust or deny the certificate. HTTPS is designed to ensure "reasonable protection from eavesdroppers and man-in-the-middle attacks, provided that adequate cipher suites are used and that the server certificate is verified and trusted." (Quote from Wikipedia)


Unless the provider has a very weird setup, I don't think you can. There are two clients cpnnecting to the server - first your PHP code which is using the client certificate, then you expect a browser somewhere to be able to bind to the same session without the client certificate? The only way this would make any sense is if the payment provider sends back a surrogate authentication token - and if they did that they'd provide detailled documentation. Obviously that is not the case.

While you could proxy the data on your server, I'd strongly recommend you switch to a different payment provider which handles the entire payment process for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号