A recently proposed version of the Kohn variational principle for the t matrix incorporating the correct boundary condition is applied for the first time to the study of nucleon-nucleon scattering. Analytic expressions can be obtained for all the integrals in the method for a wide class of potentials and for a suitable choice of trial functions. Closed-form analytic expressions for these integrals are given for Yakawa and exponential potentials. Calculations with two commonly used S-wave nucleon-nucleon potentials show that the method may converge faster than other solution schemes not only for the phase-shifts but also for the off-shell t matrix elements if the freedom in the choice of the trial function is exploited. (author).