Commit 2f6c5fc193 for openssl.org

commit 2f6c5fc193e76395d373e485f27f8794d65b73f9
Author: Shreenidhi Shedi <yesshedi@gmail.com>
Date:   Thu Jul 9 16:24:07 2026 +0530

    apps/tsget: enable use warnings

    Add "use warnings" and wrap CURLOPT_RANDOM_FILE and CURLOPT_EGDSOCKET
    setopt calls in eval blocks, as these constants were removed from
    libcurl and would cause an exception on modern installations.

    Assisted-by: Claude:claude-sonnet-4-6
    Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>

    Reviewed-by: Andrew Dinh <andrewd@openssl.org>
    Reviewed-by: Matt Caswell <matt@openssl.foundation>
    MergeDate: Fri Aug  7 13:29:37 2026
    (Merged from https://github.com/openssl/openssl/pull/31445)

diff --git a/apps/tsget.in b/apps/tsget.in
index 4fab476e5f..51b78e9245 100644
--- a/apps/tsget.in
+++ b/apps/tsget.in
@@ -8,6 +8,7 @@
 # https://www.openssl.org/source/license.html

 use strict;
+use warnings;
 use IO::Handle;
 use Getopt::Std;
 use File::Basename;
@@ -41,8 +42,11 @@ sub create_curl {
     $curl->setopt(CURLOPT_SSLCERT, $options{c}) if defined($options{c});
     $curl->setopt(CURLOPT_CAINFO, $options{C}) if defined($options{C});
     $curl->setopt(CURLOPT_CAPATH, $options{P}) if defined($options{P});
-    $curl->setopt(CURLOPT_RANDOM_FILE, $options{r}) if defined($options{r});
-    $curl->setopt(CURLOPT_EGDSOCKET, $options{g}) if defined($options{g});
+
+    # CURLOPT_RANDOM_FILE and CURLOPT_EGDSOCKET were removed from libcurl;
+    # wrap in eval so we fail gracefully on newer versions.
+    eval { $curl->setopt(CURLOPT_RANDOM_FILE, $options{r}) if defined($options{r}); };
+    eval { $curl->setopt(CURLOPT_EGDSOCKET, $options{g}) if defined($options{g}); };

     # Setting destination.
     $curl->setopt(CURLOPT_URL, $url);