GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ssl: take the OID table and the OpenSSL cipher-string parser from #80… · RustPython/RustPython@de60530

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .cspell.json
  • Cargo.lock
  • crates
    • host_env
      • Cargo.toml
      • src
        • fs.rs
        • lib.rs
        • native_certs.rs
    • stdlib
      • Cargo.toml
      • rustls-data
        • obj_mac.num
        • objects.txt
      • src
        • ssl.rs
        • ssl
          • cert.rs
          • cipher.rs
          • compat.rs
          • oid.rs
          • providers.rs
  • examples
    • custom_tls_providers.rs
  • src
    • interpreter.rs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.cspell.json‎

Copy file name to clipboardExpand all lines: .cspell.json
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@
7171
// words - list of words to be always considered correct
7272
// (compound words like pyarg, baseclass, microbenchmark are handled by allowCompoundWords)
7373
"words": [
74+
"AESGCM",
7475
"aiterable",
7576
"alnum",
77+
"COMPLEMENTOFALL",
78+
"COMPLEMENTOFDEFAULT",
7679
"csock",
7780
"coro",
7881
"contig",
@@ -82,6 +85,7 @@
8285
"deduped",
8386
"deoptimized",
8487
"deoptimize",
88+
"EECDH",
8589
"emscripten",
8690
"excs",
8791
"fdigits",
@@ -98,6 +102,7 @@
98102
"kwonly",
99103
"lossily",
100104
"mcache",
105+
"MLKEM",
101106
"oparg",
102107
"opargs",
103108
"pointee",
@@ -109,6 +114,7 @@
109114
"reraises",
110115
"reraising",
111116
"significand",
117+
"SUITEB",
112118
"summands",
113119
"TESTFN",
114120
"TZPATH",
Collapse file

‎Cargo.lock‎

Copy file name to clipboardExpand all lines: Cargo.lock
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎crates/host_env/Cargo.toml‎

Copy file name to clipboardExpand all lines: crates/host_env/Cargo.toml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ rust-version.workspace = true
88
repository.workspace = true
99
license.workspace = true
1010

11+
[features]
12+
native-certs = ["dep:rustls-native-certs"]
13+
1114
[dependencies]
1215
rustpython-wtf8 = { workspace = true }
1316

@@ -35,6 +38,7 @@ mac_address = { workspace = true }
3538
dns-lookup = { workspace = true }
3639
gethostname = { workspace = true }
3740
rustyline = { workspace = true }
41+
rustls-native-certs = { workspace = true, optional = true }
3842
socket2 = { workspace = true, features = ["all"] }
3943
which = { workspace = true }
4044

Collapse file

‎crates/host_env/src/fs.rs‎

Copy file name to clipboardExpand all lines: crates/host_env/src/fs.rs
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ pub fn metadata(path: impl AsRef<Path>) -> io::Result<Metadata> {
3636
fs::metadata(path)
3737
}
3838

39+
pub fn exists(path: impl AsRef<Path>) -> bool {
40+
metadata(path).is_ok()
41+
}
42+
43+
pub fn is_file(path: impl AsRef<Path>) -> bool {
44+
metadata(path).is_ok_and(|metadata| metadata.is_file())
45+
}
46+
47+
pub fn is_dir(path: impl AsRef<Path>) -> bool {
48+
metadata(path).is_ok_and(|metadata| metadata.is_dir())
49+
}
50+
3951
pub fn symlink_metadata(path: impl AsRef<Path>) -> io::Result<Metadata> {
4052
fs::symlink_metadata(path)
4153
}
Collapse file

‎crates/host_env/src/lib.rs‎

Copy file name to clipboardExpand all lines: crates/host_env/src/lib.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub mod fileutils;
3030
pub mod fs;
3131
#[cfg(any(unix, windows))]
3232
pub mod locale;
33+
#[cfg(all(feature = "native-certs", not(target_arch = "wasm32")))]
34+
pub mod native_certs;
3335
pub mod readline;
3436

3537
#[cfg(windows)]
Collapse file

‎crates/host_env/src/native_certs.rs‎

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// Certificates and errors returned by the platform's native trust-store
2+
/// loader. Certificate bytes stay independent of any TLS backend type.
3+
pub struct LoadResult {
4+
pub certs: Vec<Vec<u8>>,
5+
pub errors: Vec<String>,
6+
}
7+
8+
pub fn load() -> LoadResult {
9+
let result = rustls_native_certs::load_native_certs();
10+
LoadResult {
11+
certs: result
12+
.certs
13+
.into_iter()
14+
.map(|cert| cert.as_ref().to_vec())
15+
.collect(),
16+
errors: result
17+
.errors
18+
.into_iter()
19+
.map(|error| error.to_string())
20+
.collect(),
21+
}
22+
}
Collapse file

‎crates/stdlib/Cargo.toml‎

Copy file name to clipboardExpand all lines: crates/stdlib/Cargo.toml
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ssl-openssl-vendor = ["ssl-openssl", "openssl/vendored"]
2424
tkinter = ["dep:tk-sys", "dep:tcl-sys", "dep:widestring"]
2525
flame-it = ["flame"]
2626

27-
__ssl-rustls = ["ssl", "rustls", "rustls-native-certs", "rustls-pemfile", "rustls-platform-verifier", "x509-cert", "x509-parser", "der", "pem-rfc7468", "webpki-roots", "oid-registry", "pkcs8"]
27+
__ssl-rustls = ["ssl", "rustpython-host_env/native-certs", "rustls", "rustls-pemfile", "rustls-platform-verifier", "x509-cert", "x509-parser", "der", "pem-rfc7468", "webpki-roots", "oid-registry", "pkcs8"]
2828

2929
[dependencies]
3030
# rustpython crates
@@ -92,7 +92,6 @@ foreign-types-shared = { workspace = true, optional = true }
9292

9393
# Rustls dependencies (optional, for ssl-rustls feature)
9494
rustls = { workspace = true, default-features = false, features = ["std", "tls12"], optional = true }
95-
rustls-native-certs = { workspace = true, optional = true }
9695
rustls-pemfile = { workspace = true, optional = true }
9796
rustls-platform-verifier = { workspace = true, optional = true }
9897
x509-cert = { workspace = true, features = ["pem", "builder"], optional = true }

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.