我在使用GIT连接到受客户端证书保护的GIT服务器时遇到问题。我正在尝试使用Azure Pipeline Agent在全新的Azure VM上运行作业。
我正在连接到本地TFS实例,该实例通过客户端证书保护到Internet。
经过一番尝试和错误,我得到了正确形状的证书,以将代理连接到服务器。像这样使用OpenSSL
openssl pkcs12 -in cert.pfx -cacerts -nokeys -out ca.pem -passin pass:
openssl pkcs12 -in cert.pfx -clcerts -nokeys -out clientcert.pem -passin pass:
openssl pkcs12 -in cert.pfx -clcerts -nocerts -out clientcert-key-pass.pem -passin pass: -passout pass:$pfxpassword
openssl pkcs12 -in cert.pfx -out temp.pem -nodes -passin pass:
openssl pkcs12 -export -out cert-secure.pfx -in temp.pem -passout pass:$pfxpassword
Run Code Online (Sandbox Code Playgroud)
那就是乐趣的终结...
对于背景,我在Ubuntu 18.04上运行,并尝试了GIT 2.17和2.22。
当我在具有相同证书集的计算机上运行curl时,它可以正确地超过服务器上的客户端证书安全性,并让我访问基础服务,该服务返回预期的401。
但是,当使用来自GIT的相同证书时,我始终收到403错误,并且服务器由于客户端证书问题而拒绝了连接。
我正在为GIT运行的命令是
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git -c http.sslcainfo="/home/scott/ca.pem" -c http.sslcert="/home/scott/clientcert.pem" -c http.sslkey="/home/scott/clientcert-key-pass.pem" -c http.sslCertPasswordProtected=true fetch --force --tags --prune --progress --no-recurse-submodules …
git authentication https ssl-certificate azure-virtual-machine
给定的第三方脚本在一定条件下会向DOM添加一个iframe。如果iframe正确加载,则说明一切完成。但是,有时,该iframe的src会导致404,网络超时或其他错误。第三方脚本无法正常处理。
我想在我的脚本中对此进行监视,并且每当iframe加载失败时,都会触发我的脚本。有什么办法吗?它看起来像这样:
function callWhenElementFails(element) {
if (element is_a iframe)
invoke_my_handler;
else
do nothing
}
Run Code Online (Sandbox Code Playgroud)
一个简单的问题:给定一个iframe元素,我如何检查它是否已加载或失败?我可以在开发人员工具的“网络”标签下看到src失败;如何以编程方式查询此内容。
请注意,我的代码不是加载iframe的代码,并且很难修改第三方代码并向其中添加一些内容。
检测iframe src是否是可显示的抓斗,并且存在类似的问题,但不能成功。
突变观察者可能是一种方法,尽管我希望更简单的方法会更好。
我正在研究 android,我必须阅读一系列文档(我将其放入数组列表中)。每个文档都有一个子集合。
所以作为例子。
CAR
- miles
- year
- color
- blablabla
-- MAINTENANCE (subcollection)
-1
date: 123
km: 123456
-2
date: 113132323
km: 19493
Run Code Online (Sandbox Code Playgroud)
我创建了这个文档 CAR 的一个类,我能够使用 toObject( myclass.class)读取文档的字段。现在是有趣的部分。我创建了一个名为 的第二个类MAINTENANCE,包括日期和公里。在 CAR 类中,我创建了一个名为MAINTENANCEMaintenance 的数组列表的变量。
我能够毫无问题地读取 CAR 对象,但维护阵列中绝对没有任何内容
你会建议我在一个循环中读取所有数据的正确方法吗?我是否必须添加一个完整的侦听器并在阅读汽车后运行第二次阅读?
大家好..我编辑是为了更容易理解,因为我认为问题仍然存在......我改变了方法并深入挖掘:这是我的数据库:
现在...如果我只是尝试阅读子集合文档:
Task<QuerySnapshot> TEST = FirebaseFirestore.getInstance().collection("CHARGEPOINT").document("12").collection("CONNECTORS").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
QuerySnapshot data = task.getResult();
for(DocumentSnapshot documentSnapshot:task.getResult()){
Log.d("DOCUMENTDATA", documentSnapshot.getData().toString());
}
Log.d("DATA", data.toString());
}
});
Run Code Online (Sandbox Code Playgroud)
我没有结果.... Querysnapshot 总是空的。我犯了一个错误,但我真的不明白出了什么问题......
我的最终目标是拥有一个带有方法“LoadStructure”的辅助类,该方法加载集合和子集合(ArrayList)的数据,并在完成后返回包含所有数据的 ArrayList。CONNECTORS 可以是多个,这就是我选择 Arraylist 的原因
我已经可以通过我创建的自定义类读取“12”,但似乎我无法访问子集合。
我希望自动执行此页面上的一些点击,我将其用作测试,因为我刚刚学习 Selenium。
https://www.pgatour.com/competition/2019/safeway-open/leaderboard.html
当我加载页面时,我无法让我的代码自动接受并关闭 cookie 覆盖层,这阻止了我进一步的操作。
我尝试了各种方法来识别该元素,但每次都收到相同的消息。
我相信这是我需要识别的元素的 HTML:
<a class="call" tabindex="0" role="button">Agree and Proceed</a>
Run Code Online (Sandbox Code Playgroud)
我的代码的最新版本是这样的:
<a class="call" tabindex="0" role="button">Agree and Proceed</a>
Run Code Online (Sandbox Code Playgroud)
错误信息是:
Run Code Online (Sandbox Code Playgroud)selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//a[@class = 'call']"}
我想改变theme应用程序的颜色。就像我现在的主题是浅色的,但我想通过切换按钮来更改主题,例如深色模式。我的应用程序正在做一些工作。链接:https://www.howtogeek.com/361407/how-to-enable-dark-mode-for-youtube/
我构建了这个应用程序,但在全局中不起作用,它只能在当前页面中工作,就像在设置页面中工作但不能在主页或个人资料页面中工作
我没有源代码,但我使用这种类型https://www.seishin.me/dynamic-switching-of-themes-in-react-native-app/
仅一页工作,但在全局中工作就像在设置中工作一样,因为我在设置页面中编写代码,但不在个人资料页面或主页中工作。
我累了...........
android ×1
git ×1
https ×1
iframe ×1
javascript ×1
python ×1
react-native ×1
reactjs ×1
selenium ×1