I just wanted to address this:
It is known that the CIA led by Allan Dulles and the Mafia jointly attempted to assassinate at least Castro and the CIA assassinated other world leaders, so it certainly wouldn't be a stretch for them to assassinate Kennedy.
First, the Mafia wasn’t part of the CIA, though yes, the CIA did use them as assets in assassination plots against Castro.
Second, the CIA’s covert action programs (which is what the assassination plots against foreign leaders like Castro were) are run out of the National Security Council, not Langley. IOW, when conducting covert action, the CIA functions as an instrument of the White House via the NSC. I’ll note that most of the NSC-approved assassination plots against foreign leaders happened during the Kennedy administration.
Third, declassified documents over the decades have revealed that the Kennedy brothers (Jack and Bobby) were deeply involved in said assassination plots against Castro and other foreign leaders. JFK was no enemy of Langley. And CIA officials themselves have acknowledged this; I think it was Richard Helms, CIA Director under Johnson and Nixon, who said “the CIA never had a better friend” than Kennedy.
Which brings me to my final point; it would be a massive stretch (literally treason) for the CIA to murder their own boss, as opposed to Communist or Communist-sympathizing
foreign leaders or in a few cases (Trujillo and Diem—both killed during JFK’s Presidency) anti-Communist dictators who were increasingly becoming liabilities for the US. All of which happened in the context of the Cold War, obviously.
Was there tension between Kennedy and the CIA? Absolutely, especially early on during the Bay of Pigs fiasco. Just like there has been tension between the CIA and every President over the Agency’s existence with the possible exception of ex-CIA Director George H.W. Bush—but then again, he’s the exception that proves the rule, since under Bush the Cold War ended, the Soviet Union collapsed, and the CIA lost a lot of employees and funding (which it didn’t recover from until well after 9/11).
There have also long been periods of tension between Presidents and the military, as well as between Presidents and the State Department, and between Presidents and the FBI, and…