Making Minimalist HTTPS Client in C on Linux

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

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!
@godlyradmehr2004
@godlyradmehr2004 6 ай бұрын
One of the best and practical video's that I've seen❤❤❤ nice bro
@tapiomakinen
@tapiomakinen 6 ай бұрын
Love your stuff and style. Thanks for sharing!
@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.
@JonathanNelson-nelsonj3
@JonathanNelson-nelsonj3 Ай бұрын
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.
@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 :)
@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
@GearAddict90210
@GearAddict90210 6 ай бұрын
Very handy information to have, thanks for the video!
@Jonathan-ru9zl
@Jonathan-ru9zl Ай бұрын
Great content! Please consider making a video about the differences between TCP and UDP
@nirlichtman
@nirlichtman Ай бұрын
I will add to my list :)
@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)
@ikhlasulkamal5245
@ikhlasulkamal5245 6 ай бұрын
Great video, very practical and informative xD
@uzumakiuchiha7678
@uzumakiuchiha7678 6 ай бұрын
Wow that was a lot of good new information. Thank You
@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" :)
@et2124
@et2124 6 ай бұрын
Next up: https server in c :)
@mytechnotalent
@mytechnotalent 6 ай бұрын
hell yes!!! great job!!
@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
@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.
@MadMathMike
@MadMathMike 6 ай бұрын
You're the type of programmer I want to be when I grow up (I'm 37... 😂).
@spacewad8745
@spacewad8745 6 ай бұрын
amazing stuff dude
@OlegKosmakov
@OlegKosmakov 4 ай бұрын
Damn, I thought you'd implement SSL yourself, too :)
@andrzejcuber
@andrzejcuber 4 ай бұрын
i wonder if you could create a movie about simple smtp client that would enable send emails from programs in C.
@ItsCOMMANDer_
@ItsCOMMANDer_ 6 ай бұрын
Can you do minimalist https server in c?
@nirlichtman
@nirlichtman 6 ай бұрын
Yes :)
@__hannibaal__
@__hannibaal__ 6 ай бұрын
Good
@chegleeff
@chegleeff 5 ай бұрын
I tried to do this on MacOS (M1), but the OpenSSL library is missing ☹
@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
@dailydoseofshtposts6891
@dailydoseofshtposts6891 6 ай бұрын
cant belive i was just looking for this
@mattia628
@mattia628 6 ай бұрын
Make a video about dhcp
@mattia628
@mattia628 6 ай бұрын
Protocols maybe a discover
@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
@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
Рет қаралды 163 М.
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 6 МЛН
Data Analytics for Beginners in ಕನ್ನಡ
11:04
RJ Arun ಅರುಣ್
Рет қаралды 3
Making Minimalist HTTPS Server in C on Linux
16:11
Nir Lichtman
Рет қаралды 16 М.
Adding Simple System Call in Linux Kernel
7:44
Nir Lichtman
Рет қаралды 13 М.
The Importance of Error Handling in C
8:18
Nir Lichtman
Рет қаралды 29 М.
MUST KNOW bashrc customizations to boost productivity in Linux
13:38
Making Simple X11 GUI Window in C on Linux
8:18
Nir Lichtman
Рет қаралды 21 М.
i wrote my own memory allocator in C to prove a point
5:23
Low Level Learning
Рет қаралды 347 М.
Networking in C++
32:50
The Cherno
Рет қаралды 228 М.
Call By Value & Call By Reference in C
8:34
Neso Academy
Рет қаралды 1,2 МЛН
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 996 М.
WWDC 2024 - June 10 | Apple
1:43:37
Apple
Рет қаралды 10 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 37 МЛН
Iphone or nokia
0:15
rishton vines😇
Рет қаралды 1,7 МЛН
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Корнеич
Рет қаралды 1,7 МЛН
🔥Идеальный чехол для iPhone! 📱 #apple #iphone
0:36