Git over http with self signed ssl certificates

I made a webserver in my lan with git remote repository functionality. I got ssl working by following the Arch Wiki Article and generating a key by doing:

openssl req -x509 -newkey rsa:4096 -days days -keyout key_filename -out cert_filename

Then git would no longer accept the server (the server automatically moves http to https).

fatal: unable to access 'http://lan.server/git/test.git/': SSL certificate problem: self signed certificate

I found this stack exchange answer. I attempted to follow it but I’m not really sure how to get from generating the certificate and key to implementing them in the way this stack exchange answer mentions, for git to accept the ssl certificate. I’m new to webservers and trying my best but I don’t know what to do here. Are there better ways of having git accept the ssl certificate? What should I do?

Any help is appreciated,
Thank you.