<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jacob</title>
    <description>The latest articles on DEV Community by Jacob (@jacobgc).</description>
    <link>https://dev.to/jacobgc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F21284%2Fb7dca179-9765-4d80-bbd1-3ffa5d868102.jpeg</url>
      <title>DEV Community: Jacob</title>
      <link>https://dev.to/jacobgc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jacobgc"/>
    <language>en</language>
    <item>
      <title>Deno and the corporate proxy</title>
      <dc:creator>Jacob</dc:creator>
      <pubDate>Tue, 30 Jun 2020 10:24:50 +0000</pubDate>
      <link>https://dev.to/jacobgc/deno-and-the-corporate-proxy-2p32</link>
      <guid>https://dev.to/jacobgc/deno-and-the-corporate-proxy-2p32</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Information in this post is accurate as of 30/06/2020&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;This is my first post in quite a while, please feel free to let me know if I've made any mistakes or something doesn't read quite right :)&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;After seeing quite a lot of posts / news about deno I thought I'd give it a try. I'm already quite familar with NodeJS / Typescript so I was excited about the built in Typescript support, but alas I was stumped right from the welcome example :sigh:&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem
&lt;/h1&gt;

&lt;p&gt;I executed the example command &lt;code&gt;deno run https://deno.land/std/examples/welcome.ts&lt;/code&gt; hoping to see &lt;code&gt;Welcome to Deno 🦕&lt;/code&gt; but instead I was greated with this fine error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;error: error sending request for url (https://deno.land/std/examples/welcome.ts): error trying to connect: tcp connect error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  The Solution
&lt;/h1&gt;

&lt;p&gt;After a few seconds of pondering I remembered I'm behind a corporate proxy, I dug around the Deno manual and found the page on &lt;a href="https://deno.land/manual/linking_to_external_code/proxies"&gt;proxies&lt;/a&gt;. Amazing I thought, Deno supports the &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; environment variables just like NodeJS! So it set them, and executed the welcome command again.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem part 2.
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;error: error sending request for url (https://deno.land/std/examples/welcome.ts): error trying to connect: invalid certificate: UnknownIssuer&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WP7ZK4cf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/l3q2K5jinAlChoCLS/giphy.gif%3Fcid%3Decf05e473f94f42305352c9d6f9ba0eeec5c902b4eb2cbce%26rid%3Dgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WP7ZK4cf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/l3q2K5jinAlChoCLS/giphy.gif%3Fcid%3Decf05e473f94f42305352c9d6f9ba0eeec5c902b4eb2cbce%26rid%3Dgiphy.gif" alt="Shocked / Slightly annoyed glance"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;huh, another error... Looks like there is a certifiacte in the chain that isn't signed by a known certificate authority (issuer)&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution part 2
&lt;/h1&gt;

&lt;p&gt;After some googling and GitHub issue searching, I concluded the following: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I'm behind a corporate proxy that snoops on HTTPS traffic using a custom certificate that is stored in Windows&lt;/li&gt;
&lt;li&gt;Deno doesn't read certificate authrotiies from the OS. &lt;/li&gt;
&lt;li&gt;Deno relies on &lt;a href="https://github.com/ctz/rustls"&gt;rustls&lt;/a&gt; for TLS/SSL connections, which in turn relies on &lt;a href="https://github.com/briansmith/webpki"&gt;webpki&lt;/a&gt; which has its own certificate store. &lt;/li&gt;
&lt;li&gt;the &lt;code&gt;deno run&lt;/code&gt; command accepts a &lt;code&gt;--cert&lt;/code&gt; flag, with a path to the certificate(s) in PEM format (E.G &lt;code&gt;deno run --cert C:/corporateCerts.pem https://deno.land/std/examples/welcome.ts&lt;/code&gt;(This flag isn't in the Deno manual (I'm looking to change that)).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After adding in the &lt;code&gt;--cert&lt;/code&gt; flag, and executing again, I got the welcome message &lt;code&gt;Welcome to Deno 🦕&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;Hope you enjoyed the read :)&lt;/p&gt;

&lt;h1&gt;
  
  
  TL;DR
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Set &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; to your proxy address&lt;/li&gt;
&lt;li&gt;if your corporate proxy snoops on HTTPS traffic you'll need to export the certificate it uses in PEM format and put it somewhere safe&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;deno run&lt;/code&gt; with the &lt;code&gt;--cert&lt;/code&gt; flag set to the path to the exported PEM file (E.G &lt;code&gt;deno run --cert C:/corporateCerts.pem https://deno.land/std/examples/welcome.ts&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>deno</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>typescript</category>
    </item>
    <item>
      <title>I'm planning on creating a website with NodeJS, What can I use to future proof it?</title>
      <dc:creator>Jacob</dc:creator>
      <pubDate>Wed, 11 Oct 2017 01:11:58 +0000</pubDate>
      <link>https://dev.to/jacobgc/im-planning-on-creating-a-website-with-nodejs-what-can-i-use-to-future-proof-it-ab4</link>
      <guid>https://dev.to/jacobgc/im-planning-on-creating-a-website-with-nodejs-what-can-i-use-to-future-proof-it-ab4</guid>
      <description>&lt;p&gt;Basically, I'm wondering what technologies, node modules, etc I could use to either future proof it, or just make it easier to make.&lt;/p&gt;

&lt;p&gt;My current thought of things to use:&lt;br&gt;
NodeJS 8 - Backend&lt;br&gt;
EJS - Templating&lt;br&gt;
MongoDB - Database&lt;/p&gt;

&lt;p&gt;Just posting suggestions is fine, however, I'd appreciate it if you gave examples of how you have or how it can be used and some rough pros and cons of it are. (If you have an opinion that doesn't match everyone else's, I'd still love to hear it)&lt;/p&gt;

&lt;p&gt;Thanks &amp;lt;3&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Hi, I'm Jacob Gee-Clarke ❤️</title>
      <dc:creator>Jacob</dc:creator>
      <pubDate>Wed, 07 Jun 2017 14:59:23 +0000</pubDate>
      <link>https://dev.to/jacobgc/hi-im-jacob-gee-clarke-</link>
      <guid>https://dev.to/jacobgc/hi-im-jacob-gee-clarke-</guid>
      <description>

</description>
      <category>introductions</category>
    </item>
  </channel>
</rss>
