Travel to all places except the North and East is unrestricted. I do not foresee anyone getting into trouble there unless you managed to stroll into a military establishment somewhere in the jungle.
Regarding travel to the north and east, bear the following in mind.
1) Some parts of the Northern province is closed off to foreigners.
Officially, you need a permit from the ministry of defense to travel to Jaffna District, Kilinochchi District, Mulaithivu District, Mannar District (only areas north of Vidattaltivu), Vavuniya District (only areas north of Omanthai). I have heard enforcement in this regard is lax, but you can get a permit from this link. If you travel without one and get caught, just pretend you didn't know and you'd be fine to go most of the time (not guaranteed). Locals do not face any restrictions, and Indians also manage to get by most of the time.
2) Visiting the eastern province
The eastern province is open to foreigners; however steer clear of off-the-trail routes; this is not a place to go hiking (if you are not/not with a local). There can be landmines, wild animals, and worse (or better), you might be thought of as someone on espionage. I am a local and have camped and gone hiking in the east numerous times and I have been questioned and searched several times by the military as well as local police for illegal camping, tresspassing, drug traffiking, grave digging etc. (seriously). This is because many military people and police are unfamiliar with hiking and camping and do not seem to understand it; probably because of the effect of years of war.
If you do manage to get a bit off the beaten path, the east is a truly awesome experience. It is Sri Lanka at it's very best!
In the North and east, just because it is said in the law/notices does not necessarily mean you cannot do it. If you are in doubt whether something is allowed or not when you're in the north and east, go ahead and ask a police or army member, and the odds are you'll be allowed if your request looks sane. Just remember to use your common sense.
PS: If you need to know of some truly amazing lesser known places in the east, i'd be happy to share my experiences, just post a new question and let me know.