使用cypress.io测试SSL HTTPS证书 [英] Using cypress.io to test SSL HTTPS certificate

查看:128
本文介绍了使用cypress.io测试SSL HTTPS证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(注意:我交叉张贴在赛普拉斯论坛上,但不确定它的活跃程度,因此请仔细考虑,并意识到我应该首先使用StackOverlow)

(NOTE: I cross-posted to the cypress forum, but wasn't sure how active it was, so thought better of it, and realized I should have used StackOverlow in the first place)

柏树的新事物,非常喜欢它!我已经完成了教程的工作,并在文档中进行了搜索.我想知道是否可以使用cypress对我的https证书进行检查/声明.我是启用安全证书的新手,目前正在使用LetsEncrypt作为我的CA.我想浏览到不同版本的网址(例如 https://domain.tld https://www.domain.tld

New to cypress, very much liking it ! I've worked through the tutorials, and also searched in the docs. I'm wondering if I can use cypress to inspect/assert against my https certificate. I'm new to enabling a secure certificate, and am currently using LetsEncrypt as my CA. I'm looking to navigate to different versions of my url (e.g. https://domain.tld, https://www.domain.tld, http://domain.tld). I'd like to use cypress to verify that I'm getting a secure terminated connection when I expect, perhaps inspecting the cert for a the commonname ?

推荐答案

Cypress是一个JavaScript框架,测试是用JavaScript编写的.

Cypress is a JavaScript framework and tests are written in JavaScript.

因此,您可以使用npm软件包为您获取SSL证书,然后可以在代表您的证书的对象中执行所需的任何断言.

So you could use an npm package to get the SSL certificate for you and then you can perform any assertion you want in the object that represents your certificate.

我建议您使用 get-ssl-certificate npm软件包.此处.

I suggest you the get-ssl-certificate npm package. More info about and how to use it here.

这篇关于使用cypress.io测试SSL HTTPS证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆