I like Philip Kendall's answer and I'd like to expand on it:
Nothing you can do about this. Medical problems aren't in your control.
Exactly, and this is also the mindset you have to put yourself into before talking to your boss. Your health problem isn't something that you can decide to suddenly not have or that will go away if your boss pressures you hard enough. Accept that you have to take this sick leave as a fact yourself, don't feel guilty about it, don't think there is anything to negotiate about it, and state it as a fact to your boss.
I would hope that it is in your bosses best interest to have you recover as soon as possible and as completely as possible. You can frame it for him that way: "Boss, I want to make sure I'm healthy and at my best so that I can give my best for the company again once I've recovered."
You can also offer to help mitigate your absence if that mitigation doesn't endanger your recovery. Offer to help select and/or train a temp (if you have enough time for that before the surgery) and document your work so that the temp can pick it up easily. Basically anything you can do before the surgery so that you don't have to do anything while you're recovering.
Some would see this as helping your boss replace you and, depending on the boss/company, they may be right. However, you have to balance this risk with the risk of being let go because your availability for your company isn't "guaranteed" (in the bosses mind) any more. That's something you have to judge for yourself.
And, of course:
Know what your employment rights are. Get advice if necessary.
Ask your local employee representation organisation (union? citizen advice office?) about it; maybe your doctor or health insurance can point you to information about it. If that doesn't help, consider consulting a lawyer.