Boolean difference between Cylinder and Torus
Not really a direct answer, but in this case it may be easier not to use a Boolean? Create a torus...

Select desired loops,V rip those edges,
Hover - L select unwanted faces and delete
Select boundary edge loops, E extrude, right-click to drop in place
SZ scale the extrusions up and down
F fill the top and bottom faces


Assign a Bevel modifier by angle. AltN, if necessary, to recalculate normals to face outwards.