
Go, Java, Node, Perl, Python, Ruby, Rust और curl में उदाहरण प्रोग्राम जो परीक्षण करते हैं कि क्या कोई TLS ट्रस्ट स्टोर ज्ञात-खराब eMudhra CA साइटों के कनेक्शन को अस्वीकार करता है।
https://emudhra.we-have-a-problem.com/
ठीक है, आपके ब्राउज़र सही काम कर रहे हैं, लेकिन TLS सिर्फ़ ब्राउज़र में ही नहीं, बल्कि कुछ और जगहों पर भी होता है। इसलिए आपको उन सभी जगहों की जाँच करनी होगी जहाँ कोई बंडल छिप सकता है। कितनी परेशानी!
मेरे पास आपके लिए कोई समाधान नहीं है, क्षमा करें। लेकिन अगर आप बस यह जाँचना चाहते हैं कि कोई विशिष्ट भाषा बिना किसी अतिरिक्त सेटअप के सही काम करती है या नहीं, तो यहाँ कुछ सरल उदाहरण प्रोग्राम दिए गए हैं। अगर सब कुछ ठीक है तो हर एक चुपचाप कुछ भी वापस नहीं करेगा (क्योंकि यही Unix का तरीका है) और अगर यह ज्ञात खराब साइटों से कनेक्ट कर पाता है तो त्रुटि की रिपोर्ट करेगा।
यह टूल दिए गए फ्रेमवर्क/भाषा के लिए जो भी डिफ़ॉल्ट है उसका उपयोग करेगा, लेकिन आप जाँच के लिए कोई वैकल्पिक बंडल भी निर्दिष्ट कर सकते हैं। अगर इसे पता है कि कैसे, तो यह दिखाएगा कि इसने कौन सा बंडल / पथ उपयोग किया।
$ go run emudhra.go
$ go run emudhra.go /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
exit status 2
$
$ java emudhra.java
Using CA file: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/lib/security/cacerts
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$ java emudhra.java /etc/ssl/cert.pem
Using CA file: /etc/ssl/cert.pem
$
जैसा कि
यहाँ चर्चा की गई है, अपने
blocked.certs में इंटरमीडिएट जोड़ने पर विचार करें।
$ node emudhra.js
$ node emudhra.js /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ perl emudhra.pl
Using SSL_ca_file: /private/etc/ssl/cert.pem
$ perl emudhra.pl /tmp/cert.pem.bad
Using SSL_ca_file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ python3 emudhra.py
Using CA file: /opt/homebrew/etc/openssl@4/cert.pem
$ python3 emudhra.py /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ ruby emudhra.rb
Using CA file: /usr/lib/ssl/cert.pem
$ ruby emudhra.rb /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ sh emudhra.sh
Used CA file: /etc/ssl/certs/ca-certificates.crt
$ sh emudhra.sh
/tmp/cert.pem.bad
Used CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
नोट: macOS पर, आप curl(1) से नेटिव बैकएंड का उपयोग करने के लिए
कह सकते हैं, जो फिर सभी मामलों में
कनेक्शन को अस्वीकार कर देता है:
$ CURL_SSL_BACKEND=secure-transport sh emudhra.sh /tmp/cert.pem.bad
Used CA file:
$
$ cd rs
$ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.35s
Running `target/debug/rs`
$ cargo run -- /tmp/cert.pem.bad
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/rs /tmp/cert.pem.bad`
$
अपनी निर्भरताओं में कहीं, Rust समझौता किए गए इंटरमीडिएट्स पर वास्तविक ब्लॉकलिस्ट जाँच करता है, इसलिए ऐसे बंडल के साथ भी जो eMudhra के रूट पर भरोसा करता है, यह कनेक्ट करने में विफल रहता है।