He and the other leading candidates -- Senator John McCain of Arizona , former Mayor Rudolph W. Giuliani of New York and Mitt Romney , the former Massachusetts governor -- are opposed to same-sex civil unions and any compromise that would allow gays to serve openly in the military .