Making Minimalist HTTPS Client in C on Linux

  Рет қаралды 12,708

Nir Lichtman

Nir Lichtman

6 ай бұрын

I this video I will demonstrate how to create a simple HTTPS client in C using the Socket API and OpenSSL library.
You can install the OpenSSL dependencies (libraries and man pages) using the following command on Ubuntu/Debian:
apt install libssl-dev libssl-doc
For other distros, check out the corresponding OpenSSL library packages names
You can view the code I wrote in the video over here: github.com/nir9/welcome/tree/...

Пікірлер: 68
@Kabodanki
@Kabodanki 6 ай бұрын
I love how your video doesn't jump everywhere all the times
@littlecurrybread
@littlecurrybread 6 ай бұрын
I’m loving this c stuff. Would love to see more in this vein.
@utvikler-no
@utvikler-no 6 ай бұрын
This is incredible good stuff for developing small IOT devices that should listen to or read settings or logs from other devices Thanks!
@dazealex
@dazealex 6 ай бұрын
What a cool way of making a video on this. Super easy to follow. Love it!
@JonathanNelson-nelsonj3
@JonathanNelson-nelsonj3 2 ай бұрын
Thank you for these videos. As a developer with a Java shaped brain these are just what I have needed to get into C coding.
@Jonathan-ru9zl
@Jonathan-ru9zl 2 ай бұрын
Great content! Please consider making a video about the differences between TCP and UDP
@nirlichtman
@nirlichtman 2 ай бұрын
I will add to my list :)
@silakanveli
@silakanveli 6 ай бұрын
Please make video about pointers and why they are used. You have such a great way to explain concepts!
@nirlichtman
@nirlichtman 6 ай бұрын
That is a good idea for a short, thanks :)
@tapiomakinen
@tapiomakinen 6 ай бұрын
Love your stuff and style. Thanks for sharing!
@godlyradmehr2004
@godlyradmehr2004 6 ай бұрын
One of the best and practical video's that I've seen❤❤❤ nice bro
@GearAddict90210
@GearAddict90210 6 ай бұрын
Very handy information to have, thanks for the video!
@junkmeal7292
@junkmeal7292 6 ай бұрын
Great video! It would also be nice if you made a video about DNS; so we can have a full fledged https client with domain name resolution
@sirk3v
@sirk3v 6 ай бұрын
when you call man on a command, ....where is the documentation comming from, is "C" inbuilt in linux? noob question
@abulaman8713
@abulaman8713 6 ай бұрын
Yes it is
@hoteny
@hoteny 6 ай бұрын
@@abulaman8713 is the definition of ”most helpful linux user”
@sputnick1
@sputnick1 6 ай бұрын
its a program called man and he is looking at the postix c man pages (i think, not quite sure). You should install man and the respective man pages for whatever you need
@rajatmond
@rajatmond 6 ай бұрын
It depends on how you install the libraries. You can create your own manpage. I guess most installation script contains a part that also creates manpages. Linux OS written in c so even though you don't have a compiler by default, most system c APIs will have manpages by default.
@GearAddict90210
@GearAddict90210 6 ай бұрын
Man was not working out of the box on arch Linux, I think installed the manpages package to get it. I think Ubuntu etc. Have it installed from the start.
@sirk3v
@sirk3v 6 ай бұрын
broo, I have barely started on your first video, take it easy yoh...also any tips on how you manage your time or how to move fast like you would be highly appreciated, just like the videos...great work...truly god sent....(algorithim sent)
@uzumakiuchiha7678
@uzumakiuchiha7678 6 ай бұрын
Wow that was a lot of good new information. Thank You
@ikhlasulkamal5245
@ikhlasulkamal5245 6 ай бұрын
Great video, very practical and informative xD
@pianissimo7121
@pianissimo7121 6 ай бұрын
Man linux seems to much better than windows. I am really new to programming and stuff, will install linux this weekend or sometime.
@nirlichtman
@nirlichtman 6 ай бұрын
I actually like both Windows and Linux so my setup is actually Debian Linux running on top of Windows using WSL
@MadMathMike
@MadMathMike 6 ай бұрын
You're the type of programmer I want to be when I grow up (I'm 37... 😂).
@Kar7ik28
@Kar7ik28 6 ай бұрын
Great video man!!!! if possible can you discuss the step by step procedure to do the task instead to writing functions on the go ?
@Stabby666
@Stabby666 6 ай бұрын
He's explaining the steps as he goes. You might want to start on a simpler topic if you haven't tried networking code before. This is pretty straight forward for people with some experience in networking really. The man pages he's using are also available to you, to read more if you need to.
@Kar7ik28
@Kar7ik28 6 ай бұрын
@@Stabby666 i am assuming the tutorial is for beginners. Just discussing the points beforehand rather than going straigh to the code might be more helpful to beginners
@Stabby666
@Stabby666 6 ай бұрын
@@Kar7ik28 I don’t understand what you mean. I think you should have the basic knowledge of how socket connections work from a networking perspective before considering writing code. Is this the part that’s causing confusion? Guess I’m not understanding where you have problems with this.
@mEm__96
@mEm__96 6 ай бұрын
Very, very insightful content ! I also have a question, more a curiosity. I got caught at 4:59 by the long list of autocompletion. Is it the LSP, or something else? Because, it look like the Vim built-in autocompletion functionality, just extended to search into included files. If so, I'd love to know how made it to work like that.
@nirlichtman
@nirlichtman 6 ай бұрын
Actually, it's the built in vim autocomplete (CTRL+N), by default it also searches included files when auto completing, more information about this on ":help 'complete" :)
@mytechnotalent
@mytechnotalent 6 ай бұрын
hell yes!!! great job!!
@spacewad8745
@spacewad8745 6 ай бұрын
amazing stuff dude
@dailydoseofshtposts6891
@dailydoseofshtposts6891 6 ай бұрын
cant belive i was just looking for this
@et2124
@et2124 6 ай бұрын
Next up: https server in c :)
@OlegKosmakov
@OlegKosmakov 4 ай бұрын
Damn, I thought you'd implement SSL yourself, too :)
@__hannibaal__
@__hannibaal__ 6 ай бұрын
Good
@andrzejcuber
@andrzejcuber 5 ай бұрын
i wonder if you could create a movie about simple smtp client that would enable send emails from programs in C.
@TheMasterAbdul
@TheMasterAbdul 6 ай бұрын
Super
@anon_y_mousse
@anon_y_mousse 6 ай бұрын
The meme version of this would be using wget or curl through the system() function.
@nirlichtman
@nirlichtman 6 ай бұрын
technically still in C 😂😂 I am not sure about wget but I think curl does have a library for C called libcurl that can be used to quickly bring up a https client
@ItsCOMMANDer_
@ItsCOMMANDer_ 6 ай бұрын
Can you do minimalist https server in c?
@nirlichtman
@nirlichtman 6 ай бұрын
Yes :)
@shivampatel4461
@shivampatel4461 6 ай бұрын
hey , what man pages are you using ? , i am on arch , so it doesn't have installed by default
@nirlichtman
@nirlichtman 6 ай бұрын
On Arch you can install the man-pages package which will include the man pages for system calls and c lib calls as well. For the SSL related man pages you can install the openssl package
@shivampatel4461
@shivampatel4461 6 ай бұрын
thanks@@nirlichtman
@chegleeff
@chegleeff 6 ай бұрын
I tried to do this on MacOS (M1), but the OpenSSL library is missing ☹
@mattia628
@mattia628 6 ай бұрын
Make a video about dhcp
@mattia628
@mattia628 6 ай бұрын
Protocols maybe a discover
@nebulaworld915
@nebulaworld915 6 ай бұрын
Great video!!! But I have a problem here, when I execute "man sockaddr" it says "No manual entry for sockaddr", What is strange is that after I install "manpages-dev glibc-doc manpages-posix manpages-posix-dev ", "No manual entry for sockaddr" is still displayed. Do you have this problem? Or what should I do?
@nirlichtman
@nirlichtman 6 ай бұрын
Thanks! What distro are you using?
@nebulaworld915
@nebulaworld915 6 ай бұрын
Thanks for your replay, my distro is Ubuntu and versions 18.04.6 LTS (Bionic Beaver) and 22.04.3 LTS (Jammy Jellyfish)".@@nirlichtman
@nirlichtman
@nirlichtman 6 ай бұрын
Interesting, supposed to work, do the other manpages exist, for example socket? how about scanf?
@nebulaworld915
@nebulaworld915 6 ай бұрын
Yes, manpages for socket and scanf exist, and executing "man ncurses" after installing "ncurses-doc" is also useful, which is weird.@@nirlichtman
@wahffle6729
@wahffle6729 6 ай бұрын
Is there a reason as to why you're sending two CRLFs in your http request? Particularly because you're on linux
@nirlichtman
@nirlichtman 6 ай бұрын
Yes, HTTP protocol works with CRLFs
@wahffle6729
@wahffle6729 6 ай бұрын
Huh, interesting, only ever worked with TCP in C, the more you know. Also, great video, excited to see what you have for us up next.
@BennyPowers
@BennyPowers 6 ай бұрын
סחתיין מלך
@nirlichtman
@nirlichtman 6 ай бұрын
תודה!
@gaeshows1938
@gaeshows1938 6 ай бұрын
void main wtf?
@grijjly6091
@grijjly6091 5 ай бұрын
reading 1023 byte is mistake or trick ?
@nirlichtman
@nirlichtman 5 ай бұрын
It is on purpose; it makes sure that the buffer always ends with a null terminator (since I initialize the whole buffer with zeros, I read one less than the buffer length to always keep a zero in the end)
@grijjly6091
@grijjly6091 5 ай бұрын
@@nirlichtman okay but why ?
@nirlichtman
@nirlichtman 5 ай бұрын
@@grijjly6091 it is a good practice to leave a null terminator in the end in buffers you plan to treat as strings, to minimize the risk of string functions like strchr for example continuing beyond the buffer limits, I will talks about this among other tips on a future vid
Making Minimalist Snake Game in C on Linux
8:01
Nir Lichtman
Рет қаралды 28 М.
Making Simple Linux Distro from Scratch
11:51
Nir Lichtman
Рет қаралды 165 М.
OMG😳 #tiktok #shorts #potapova_blog
00:58
Potapova_blog
Рет қаралды 2,5 МЛН
Which one is the best? #katebrush #shorts
00:12
Kate Brush
Рет қаралды 25 МЛН
Making Minimalist HTTPS Server in C on Linux
16:11
Nir Lichtman
Рет қаралды 16 М.
Making Simple Clipboard Viewer in C on Windows
4:55
Nir Lichtman
Рет қаралды 12 М.
Symbolic AGI: How the Natural Will Build the Formal
43:32
Positron's Emacs Channel
Рет қаралды 7 М.
Making Simple Windows Driver in C
7:26
Nir Lichtman
Рет қаралды 324 М.
Adding Simple System Call in Linux Kernel
7:44
Nir Lichtman
Рет қаралды 13 М.
i wrote my own memory allocator in C to prove a point
5:23
Low Level Learning
Рет қаралды 349 М.
ThePrimeagen On Running Linux
9:40
Tech Over Tea
Рет қаралды 195 М.
I made the same game in Assembly, C and C++
4:20
Nathan Baggs
Рет қаралды 656 М.
Making Minimalist Web Server in C on Linux
10:23
Nir Lichtman
Рет қаралды 228 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,6 МЛН
Asus  VivoBook Винда за 8 часов!
1:00
Sergey Delaisy
Рет қаралды 757 М.
Неразрушаемый смартфон
1:00
Status
Рет қаралды 1,4 МЛН
Нашел еще 70+ нововведений в iOS 18!
11:04