When using the keygen element of HTML5, form messages (among other things) contain a request to sign a certificate (in SPKAC format) to the server. The server then sends the corresponding certificate using the mime-type application / x-x509-user-cert. I implemented this without a problem.
Now my problem is how can I continue the flow, deliver the certificate and redirect to another page. I tried two things and both failed: (this is flask code)
r = Response(userCert, status=302, mimetype='application/x-x509-user-cert')
r.headers['Location'] = url_for('index')
r = Response(userCert, mimetype='application/x-x509-user-cert')
r.headers['Refresh'] = "1; url=%s" % url_for('index')
In the first case, the browser cannot install the certificate, but redirects it correctly; In the latter case, the browser (FF) installs the certificate, but does not go to a new page.
source
share