Your database connection can be configured to encrypt traffic and to accept any certificate from your server. Not a grand solution, but it worked for me.
The resulting connection string should look like this:
"[...];Encrypt=True;TrustServerCertificate=True"
I love StackOverflow :D
Alice: "Hey, I get a certificate error here. What should I do?" Bob: "Just disable certificate verification completely" Charles: "That's insecure" Bob: "Look, it worked for me" Alice: "Thanks, works perfectly!"
Give a programmer the choice between spending a couple of hours learning about certificates and adding one small flag to a config file (but risking global annihilation) and I can already tell you what is going to happen.
I was involved on a discussion last week on reddit... there's an issue on how PHP == works, and it makes comparing passwords tricky if you use md5 or sha. and long story short, 0e12345 == 0e54321 is true... the proper fix is to get rid of md5 or sha, use hash_equals or use a proper password management library... the "timeline expired fix" is to replace == with ===, and git commit -m "fixed password storage forever"
OP said it's stupid programmers would do the "timeline expired fix" because it's trivial to git clone something, test, alter the database schema and convert the passwords to use bcrypt or pbkdf2... I reminded him that the proper fix is the way to be done, but it's not easy to find a programmer managing a convoluted code base that is willing to point the issue AND be responsible for the change AND end up responsible when an obscure module breaks three months down the line
I like PHP, it gave me my second job, landed me on a sysadmin role that ended up deciding my career and I love that... but for the uninitiated, it's a loaded gun with a hair trigger...
it's the opposite of C, C is a good dog that bites your hand if you come home without calling him first. PHP is a guard dog that can let anyone enter unless you tell him not so
@nobody Yes, you can. You just generally need to be careful with it
If you drop the gun, it's very much possible for it to shoot
@ThoriumBR So, C# has some...interesting features. Some of them exist, but don't see regular use, because most devs don't need them. And others come loaded with some expectations that you don't have to meet
@nobody There's good OOP, and bad OOP. Bad OOP is overly using design patterns when not useful. Bad OOP is C++ or Java. Good OOP is the Linux Kernel (yes I know it's written in C) or Rust or Go. doc.rust-lang.org/book/ch17-00-oop.html
You expect that a property with a setter to correspond to some internal variable
For example, if you set car.Color = Color.Red, then you expect that car.Color will return Color.Red when subsequently called...
Well...it doesn't have to
Imagine a property called HP in the Player class. Reading the property returns the maximum HP of the player, while writing the property changes the current HP.
So Player.HP = Player.HP is actually code that changes the players HP to maximum.
The designers or Java now tell NOT to use inheritance, which was at first the go to OOP paradigm: use inheritance whenever possible. This lead to horror that is the Java standard library.
The reason this is such a great obfuscation technique is because accessing a property actually means calling a function, but most people think it's just accessing a variable.
And 99.999999% of the time it is...
So they happily call functions, which could do all manners of messed up things, when they just want to read a variable
You see, the idea being an implicit cast is that you can write code like double angle = 90
90 is an integer value, not a double value. But the idea of 90 and 90.0 being equivalent makes sense, doesn't it?
So the .NET library allows you to implicitly cast integer to double. Meaning that whenever an integer value is encountered where a double is expected, it just gets casted into a double.
So...code that gets called "invisibly", just by doing something simple as assigning a value to a variable? SIGN ME UP!
How to hide code 101: implicit cast (instead of proper typing), operator overload (instead of clear operation), reflection and factories (the banes of debugging).
Also, function overloading also has an implicit assumption that the function is going to do a similar thing with the different variables or types
But what if print(int) prints to stdout, print(double) prints to a log file, print(float) physically prints a new page, print(object) orders a new business card with the object's .ToString() printed on it
@MechMK1 That why when auditing cryptographic code, we (at my work) never trust the documentation. Is it really compliant with the RFC? Most likely not.
Sure, that may seem excessive, but imagine a function like DB.GetConnection(), which fetches an existing connection from a connection pool, and DB.GetConnection(string), which creates a new connection from the string, and closes a connection from the connection pool.
@A.Hersean Mhm, but most people don't have time for that
real world example. last week I was dissecting an REXX exec and saw something like this: IF UPPER(USER) = "sOMEUSER"... and I asked the senior sysadmin about that and said that this IF will always return false, looked that the programmer pressed the Shift one char too late.
he said this is how they add debug stops on the code... when the code works, they mess a little on the if condition but let the code there
But sometimes it is easier to let people mess the stuff the way they want to mess it, because it will happen anyway when you are not looking. So teaching how to mess cleanly is a lesser evil.
@nobody Comment for yourself in 6 months. Would you rather read your block of 10 lines to understand what it does, or would you prefer to read a one-line comment? See comments as post-it notes saying "don't forget that the point of this code is to do this". Comment the purpose, not the actions. The actions are in the code, the purpose is not, so comments fill the gap. Proper naming of functions and data structures can be enough, but sometimes it is barely enough: then it's time to comment.
I had to write code, which parses a proprietary file format,
While there was documentation, the documentation did not match the actual file format
So I had to include file maps as ascii tables in comments
And explain what each field did
So we had lovely comments like "// Even though the official documentation claims animations were added in version 4, support for animations was actually implemented in version 3, but remained unused"
Or, my favourite: "// The documentation (version 2011-08) on page 58 claims that having both X and Y set is invalid and results in a crash. However, many official sprites have exactly X and Y set, and I'm sure it means something, but I have no idea what"
@FireQuacker Hopefully no memory corruption occurs...
But assuming it does, the return address on the stack would get overwritten with a pointer to a darknet diaries episode. Shit, I don't know what would happen after that
If the project in question was not an anti-adblocker, the question would be fine on its own. That you do not like the project is moot. Expressing yourself that you do not like the project is fine, if not distracting from the topic at hand. My actions were to maintain focus on the question and not...
Can't see why schroeder got two downvotes on this
Oh I see. It was just the OP and this guy. Also, looks like he won't be satisfied until @RoryAlsop weighs in.
@djsmiley2kStaysInside Our problem is that we have something like only 1.5 active mods. So most of the time, schroeder just has to deal with stuff himself.
To be fair, schroeder is super active, so we almost don't need other mods, unless schroeder needs a break or edge cases like this (which don't come up very often)