【发布时间】:2014-12-20 15:56:01
【问题描述】:
当使用 HTML5 keygen 元素时,表单(除其他外)向服务器发布证书签名请求(SPKAC 格式)。然后服务器发送相应的 mime-type application/x-x509-user-cert 证书。我实现了这个没有问题。
我现在的问题是如何继续流程、交付证书并重定向到另一个页面。我尝试了两件事,都失败了:(这是烧瓶代码)
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')
前一种情况,浏览器安装证书失败,但重定向正确; 在后一种情况下,浏览器 (FF) 会安装证书,但无法转到新页面。
【问题讨论】:
-
同时,我还尝试了一个 mime 多部分响应,分别包含子类型“mixed”和“mixed-replace”。前一种尝试似乎没有太大作用,在后者中,我得到一个文件保存对话框...
标签: html html5-keygen