Nitsche method for weakly enforced Dirichlet boundary conditions