The dress code for entrance to St. Peter's

You don't have to wear a suit or anything like that, but shorts are definitely out of favor at the largest church in Christendom -- as are backless dresses and miniskirts. I wondered if they would let in a man wearing an appropriate long dress, and figured that the Italian military police probably had a special cell set aside for people who tried stuff like that.