how can I redirect to https which require certain sertificate for access
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.
精彩评论